【发布时间】:2017-07-28 16:37:26
【问题描述】:
我购买了一个新的 VPS,并尝试转移我正在工作的 ZendApp(以前使用 DirectAdmin 进行托管)。现在我用 php5 和 mysql 安装 nginx,这是我的 php 配置 - 效果很好
http://178.216.200.85/info.php
我在 php.ini 中打开了显示错误,它在可写 /_cache/ 文件夹中显示错误,所以我将其设置为 777 权限。错误已解决,但我仍然有错误,在我的网站上看不到任何内容http://178.216.200.85/index.php
我没有任何 .htaccess 文件
这是我的 /etc/nginx/sites-avaible/默认内容
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name 178.216.200.85;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
我应该添加什么或一些东西来在新服务器上运行我的应用程序?
任何建议都会很有价值
【问题讨论】:
-
你能用
error_reporting(-1);添加错误本身吗? -
不确定是否可以共享目录结构?可能是由于位置尝试更改如下:
location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { fastcgi_pass unix:/usr/local/zend/tmp/php-fastcgi.socket; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } -
@mim 我应该在哪里添加您的代码?
-
@TomekR 您的项目 index.php 或者您可以打开配置 ini 上的错误。
-
@ShahrozeNawaz 和你的代码我在根目录和 /info.php 文件中有 502 Bad Gateway 错误
标签: php .htaccess nginx zend-framework vps