【问题标题】:Nginx and Zend configurationNginx 和 Zend 配置
【发布时间】:2014-07-23 01:17:09
【问题描述】:

我的 Zend 应用程序有问题。当我打开http://ip-193-187-64-113.e24cloud.com/ 时,只有一个空白页面,而不是加载的布局。 这是我的 nginx.conf(包含在主 nginx.conf 中)

server {
    listen          80;
    server_name     localhost;

    error_log       /var/log/postgre.yourdomain.com_error.log error;

    root   /var/www/test/public;
    index  index.html index.php;

    location ~ [^/]\.php(/|$) {
       fastcgi_split_path_info ^(.+?\.php)(/.*)$;
       if (!-f $document_root$fastcgi_script_name) {
           return 404;
       }

       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index index.php;
       include fastcgi_params;
   }
}

我使用的是 Ubuntu 14.04、nginx 和 postgresql、php 5.5

感谢您的帮助!

【问题讨论】:

  • 有关专业服务器、网络或相关基础设施管理的问题不在 Stack Overflow 的主题范围内。

标签: php zend-framework nginx


【解决方案1】:

您的 PHP 脚本中可能有错误,但禁用了 PHP 错误显示。这是 Ubuntu 中 PHP 的默认设置。

您可以通过搜索配置选项display_errors 并将其设置为Onphp.ini 中启用它们。

或者,您可以使用以下 PHP 指令从您的代码中启用它们:

ini_set('display_errors', 'On');

【讨论】:

  • 相同的 PHP 脚本文件正在我的本地机器上运行。此外,在服务器上显示错误已启用。
  • 尝试查看 nginx 错误日志。如果有 nginx 相关的错误,这里应该会显示出来。您也可以尝试显示phpinfo() 页面,看看有什么变化。
  • 我清除了error.log,重新加载nginx后error.log文件为空
  • 访问日志呢?您可以在那里检查您的请求状态,这将确保您的请求得到正确处理。我对 Zend 了解不多,但也许你什么都不显示是因为没有什么可显示的?
  • Access.log 不包含任何看起来很奇怪的内容。在我看来问题出在 nginx.conf 但我不知道我可以修复什么以及如何修复。
猜你喜欢
  • 1970-01-01
  • 2023-03-25
  • 2014-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-11-27
  • 2018-08-31
  • 2021-08-14
相关资源
最近更新 更多