脚本宝典收集整理的这篇文章主要介绍了Heroku PHP“Getting Started”不在OSX上本地运行,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
https://github.com/heroku/php-getting-started.git
使用以下命令
$sudo heroku local web
但我到目前为止
[OKAY] Loaded env .env File as KEY=VALUE Format [OKAY] Trimming display Output to 151 Columns 17:30:30 web.1 | DOCUMENT_ROOT changed to 'web/' 17:30:30 web.1 | 4 PRocesses at 128MB memory limIT. 17:30:30 web.1 | Starting PHP-FPM... 17:30:32 web.1 | Starting httpd... 17:30:32 web.1 | Application ready for connections on port 8080. 17:30:32 web.1 | (13)PErmission denied: AH00072: make_sock: Could not bind to address [::]:80 17:30:32 web.1 | (13)Permission denied: AH00072: make_sock: Could not bind to address 0.0.0.0:80 17:30:32 web.1 | no listening sockets available,shutting down 17:30:32 web.1 | AH00015: Unable to open LOGs 17:30:32 web.1 | Process exited unexpectedly: httpd 17:30:32 web.1 | Going down,terminating child processes... [DONE] Killing all processes with signal null 17:30:32 web.1 Exited Abnormally
任何可能导致权限的想法都会在设置时拒绝错误:80即使我sudo?或者为什么heroku本地尝试使用80端口?
部署到heroku时一切正常.
这是完整的教程:
https://devcenter.heroku.com/articles/getting-started-with-php
编辑
当我尝试手动设置端口时
$heroku local web -p 5000
[OKAY] Loaded ENV .env File as KEY=VALUE Format [OKAY] Trimming display Output to 151 Columns 08:06:33 web.1 | DOCUMENT_ROOT changed to 'web/' 08:06:33 web.1 | 4 processes at 128MB memory limit. 08:06:33 web.1 | Starting PHP-fpm... 08:06:35 web.1 | Starting httpd... 08:06:35 web.1 | Application ready for connections on port 5000. 08:06:35 web.1 | (13)Permission denied: AH00072: make_sock: Could not bind to address [::]:80 08:06:35 web.1 | (13)Permission denied: AH00072: make_sock: Could not bind to address 0.0.0.0:80 08:06:35 web.1 | no listening sockets available,shutting down 08:06:35 web.1 | AH00015: Unable to open logs 08:06:35 web.1 | Process exited unexpectedly: httpd 08:06:35 web.1 | Going down,terminating child processes... [DONE] Killing all processes with signal null 08:06:35 web.1 Exited Abnormally
在开始时动态注入一个配置,所以你需要一个非常标准的PHP和Nginx(Debian等不会工作,例如,因为它甚至没有工作“Nginx”或“httpd”二进制文件可以开始).只有Nginx 1.8兼容; Apache需要启用一些模块(主要是mod_Proxy_fcgi),并且不能绑定到本地端口.
这意味着Heroku必须提供大量不同的客户特定本地设置,所以最好的答案是“只为你的应用设置一个vhost就像你一直做的那样,并使用例如https://packagist.org/packages/josegonzalez/dotenv为你的环境瓦尔”.也就是说,不幸的是,目前PHP中的Web服务器设置状态.
在你的特定情况下,Apache正在启动,然后加载它的/etc/apache2/httpd.conf配置,它绑定到端口80.这不是heroku-PHP-apache2启动脚本可以阻止的,因为它会有发送与您的特定环境匹配的配置,这是不可能的,因为它无法知道本地系统配置的所有方面,例如要加载什么模块,或者它们甚至在哪里 – 它们是驻留在/usr/libexec / apache2 /,还是/usr/local/apache2 / modules /,还是其他地方? (Apache支持多种目录布局).
解
你仍然可以尝试让它工作;实际上它在Mac OS上相当容易.我总是使用https://github.com/Homebrew/homebrew-apache的Apache(brew install homebrew / apache / httpd24 –with-mpm-event).在全局配置中(在/usr/local/etc / apache2 /中),启用Mod_proxy和mod_proxy_fcgi,并注释掉Listen指令.
以上是脚本宝典为你收集整理的Heroku PHP“Getting Started”不在OSX上本地运行全部内容,希望文章能够帮你解决Heroku PHP“Getting Started”不在OSX上本地运行所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。