zend guard load 问题。
Closed this issue · 16 comments
你好!
我将 yourphp 部署到 heroku 之后,成功安装结束后,回到 admin 界面时,出现 Zend2014... 的乱码。因为没有启用 ZendGuardLoader,然后我按照你的 Readme 更新后,应用出错,说 app/apache 目录找不到。
请问这个问题怎么解决?谢谢!
详细信息如下:
2014-12-13T05:12:07.372230+00:00 heroku[web.1]: Starting process with command sh conf/web-boot.sh
2014-12-13T05:12:08.465570+00:00 app[web.1]: sed: can't read /app/apache/conf/httpd.conf: No such file or directory
似乎是 heroku 的目录结构变化了,apache 放在 vendor/bin 下面,但是对于 conf/httpd.conf 文件,不知道 heroku 放在哪里?
Heroku那边现在没怎么用了,对目录不是很熟。
Coding的演示平台貌似是用的Heroku的buildpark,刚刚上去看了一下,Apache2的启动脚本里有这么两句:
httpd_config_include=${httpd_config_include:-"$HEROKU_APP_DIR/$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/apache2/default_include.conf"}
和
httpd_config=${httpd_config:-"$HEROKU_APP_DIR/$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/apache2/heroku.conf"}
对应的应该是
vendor/heroku/heroku-buildpack-php/conf/apache2/default_include.conf
和
vendor/heroku/heroku-buildpack-php/conf/apache2/heroku.conf
同一目录下还有 httpd.conf.default 不过貌似没被用到的样子。
你可以去Coding创个PHP项目然后开启演示平台,在文件管理里面能看到它的目录和文件内容。
Heroku那边记得用 heroku run bash 命令也能进到应用所在目录。
希望能帮到你。
谢谢你的回复!正在研究https://coding.net ,你说的 coding 演示平台是这个吧?
用 heroku run bash 进到 apache2 目录后发现其中并没有 bin/httpd 这个文件。你还有当时的整个 apache 这个目录么?包括那个 httpd 文件的。
嗯,演示平台是那个。
你是需要知道httpd这个命令的所在位置吗?我创了个Heroku应用试了一下,用
which httpd
得到的结果是
/app/.heroku/php/sbin/httpd
find命令也能用,不过搜的时候有些地方权限不够会提示。
要得到上面的文件夹可以用tar打包然后用scp传,或者传个芒果云一类的PHP文件管理器上去。单个的文本文件的话,Coding演示平台的文件管理能看到内容。
好的,谢谢! 我试试看。
This project is too old to work with Heroku now. Nowadays having a php app with zend loader may be easier than before.
This is how to create a php app in heroku:
https://devcenter.heroku.com/articles/getting-started-with-php
You can simplely change the composer.json to have php 5.3 and zend loader.
Hello
Good afternoon
I think you got confused because
Zend Loader is not the same thing as Zend Guard Loader
Hello
Good Morning
Zend Guard Loader support actually worked on the server
But when adding the "ext-zend-guard-loader" require in composer.json, error is displayed in Heroku
Add the following item in composer.json to "require"
"ext-zend-guard-loader": "*"
On other servers and even the local environment works, but in Heroku is not working
I think the reason is composer works with buildpack, and it's before the Zend Guard Loader is loaded.
After the app created, run bash by heroku cli to go inside to the app, and run composer update works well, but it won't be saved by the design of Heroku.
Heroku builds the environment by buildpack, and then clone user code in their git, final start service by script in Procfile. Unluckly, it seems changing Procfile doesn't work in official buildpack.
So I think if you want to require ext-zend-guard-loader in composer, which means you should have Zend Guard Loader in buildpack, you may should clone the official buildpack and change it.
Hello
Good afternoon
I got to create a builpack where Zend Guard Loader is added but it does not work, I think I will not use this request because I could not solve this situation
If you are interested in the builpack I mentioned, it is the following
https://github.com/mozgbrasil/heroku-buildpack-php
Thank you so much for everything
Hello
Good afternoon
You have put some file encrypted By Zend Guard Encoder in Heroku ?
How can you do this test?
I put a file but a error 503 is displayed
Hello
Good afternoon
Opcache support was missing to work properly
Then I put the files based on the following package
Zend-loader-php5.6-linux-x86_64
If you have interest I have just made available the following application for heroku
I'll be perfecting this app over time
https://github.com/mozgbrasil/heroku-magento
Thank you very much for your attention.
Oh, I updated, thanks.
I forked the buildpack and tested, Heroku uses a php-min-7.0 to run composer in init, it seems there won't be a zend guard loader can work with php 7.
And Heroku will prefixed all package with heroku-sys/, just like namespace. ext-zend-guard-loader isn't in their list so there will be a can't find error.
I built a php 5.6 to replace the default php 7 in buildpack, and replace heroku-sys/ext-zend-guard-loader by ext-zend-guard-loader in composer.json when compile script in runing, there is the buildpack.
Now it seems can add "ext-zend-guard-loader": "*" to composer.json.
Thank you my friend