我刚刚安装的Nginx和PHP5-FPM,我想测试它在端口82因此,我呼吁http://mysite.com:82/test555.php,我什么也看不见。只是一个白色的屏幕。没有错误,没有警告,我什么都没有看到:)没有nginx的错误日志和php5-fpm的错误日志-但是...没有任何错误。我不明白这是怎么回事。请帮我找出来。
root@localhost:# echo "<?php phpinfo(); ?>" > /home/www/public_html/test555.php
root@localhost:# chmod 755 /home/www/public_html/test555.php
root@localhost:# cat /etc/nginx/sites-available/default
server {
listen 82;
root /home/www/public_html;
index index.php index.html;
server_name mysite.com;
access_log /var/log/nginx/nginx-access.com.log;
error_log /var/log/nginx/nginx-errors.com.log;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REMOTE_ADDR $remote_addr;
}
}
root@localhost:# /etc/init.d/nginx status
* nginx is running
root@localhost:# /etc/init.d/php5-fpm status
* php5-fpm is running
root@localhost:# ls -la /var/run/php5-fpm.sock
srw-rw-rw- 1 root root 0 Feb 3 01:14 /var/run/php5-fpm.sock
root@localhost:# cat /var/log/php5-fpm.log
....
[03-Feb-2014 01:14:52] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
[03-Feb-2014 01:14:52] NOTICE: fpm is running, pid 19080
[03-Feb-2014 01:14:52] NOTICE: ready to handle connections
root@localhost:# cat /var/log/nginx/nginx-access.com.log
...ip... - - [03/Feb/2014:01:29:44 +0000] "GET /test555.php HTTP/1.1" 200 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:26.0) Gecko/20100101 Firefox/26.0"
root@localhost:# cat /var/log/nginx/nginx-errors.com.log
root@localhost:#
接下来我该怎么做才能了解发生了什么事?我认为它应该可以正常运行。PHP脚本向我返回了code = 200,但没有看到输出。它从来没有被调用过,因为我试图在那里添加file_put_contents,而它实际上从未被nginx调用过。
我使用的是今天完全升级的ubuntu 12.04。
我有一个类似的问题,nginx正在中途处理一个页面,然后停止。nginx日志上没有错误。我通过更改nginx fastcgi缓冲来解决它。参见stackoverflow.com/a/43294078/1008916
—
Mugoma J. Okomba,
/var/log/nginx/nginx-errors.com.log
什么?