【问题标题】:Need help configuring php on nginx at openshift需要帮助在 openshift 的 nginx 上配置 php
【发布时间】:2015-01-09 02:49:38
【问题描述】:

我是 openshift 和 nginx 的新手。这是我在 nginx 上使用 php 5.5 创建 DIY 应用程序的第一个实验。 Nginx 服务器运行良好,但是当我添加 php-fpm 配置时:

...
location ~ ^/index.php(/|$) {    
root html;    
include fastcgi_params; 
fastcgi_pass unix:${OPENSHIFT_RUN_DIR}/php-fpm.socket;    
fastcgi_index index.php;    
fastcgi_param SCRIPT_FILENAME html/$fastcgi_script_name;    
fastcgi_param PATH_INFO $fastcgi_script_name;    
fastcgi_intercept_errors on;  
}
...

在 nginx.conf 中,我的浏览器出现 503 错误,提示服务不可用。我通过许多建议修改了上面的脚本,但仍然没有运气。请问有人吗?谢谢

ps : 我也关注了来自 github 的 https://www.openshift.com/forums/openshift/installing-php-fpm-and-nginx,但仍然没有运气

【问题讨论】:

  • 你的日志怎么说?尝试运行“rhc tail ”并粘贴到输出中
  • 执行“rhc tail ”后,变量名似乎有错误。 Nginx 无法识别 var $openshift_run_dir。我会解决它。谢谢尼哈维

标签: php nginx configure openshift


【解决方案1】:

我建议你创建一个Downloadable cartridge 而不是 DIY。目前 GitHub 上有几个 nginx-php 社区插件,例如。 OpenShift Nginx PHP-FPM Cartridge 来自 Getup Cloud,您可以通过一个命令轻松启动它:

rhc app create php https://reflector-getupcloud.getup.io/reflect?github=getupcloud/openshift-nginx-php-fpm

参考资料:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-20
    • 2018-04-24
    • 1970-01-01
    • 2013-04-16
    • 2011-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多