你需要访问哪个页面,查看错误,就在哪个配置的域名下面进行配置
例如:
1.先找到要配置的文件 在进行编辑
# vim ×××××.××××.×××.conf
2.进去之后在server里面写
server {
access_log /data/log/www;
listen 80;
server_name abc.com www.abc.com;
location / {
root /data/www/www;
index index.html index.htm;
}
error_log logs/error_www.abc.com.log error; (这是查看错误日志文件的位置)
}
3.nginx -t 检查一下Nginx是否有误,没报错后方可进行重启
service nginx restart 重启
4.然后运行页面 报错了直接进入错误日志中进行查看
直接 # vim logs/error_www.abc.com.log
二、https://blog.csdn.net/czlun/article/details/73251714
三、
如何快速找到php和Nginx的错误日志定位问题?
1. ps -ef | grep php 查看所在位置
( /usr/local/php/etc/php-fpm.conf)
2. cat /usr/local/php/etc/php-fpm.conf
error_log = /DATA/log/php/php_fpm.err 这个是php-fpm的错误日志
php_admin_value[error_log] = /DATA/log/php/php_errors.log 这个是php.ini的错误日志
3. ps -ef | grep nginx 查看Nginx所在的位置
/etc/nginx/nginx.conf
error_log /var/log/nginx/error.log; nginx 所在的错误日志
4.php --ini 查看php.ini所在的位置
你需要访问哪个页面,查看错误,就在哪个配置的域名下面进行配置
例如:
1.先找到要配置的文件 在进行编辑
# vim ×××××.××××.×××.conf
2.进去之后在server里面写
server {
access_log /data/log/www;
listen 80;
server_name abc.com www.abc.com;
location / {
root /data/www/www;
index index.html index.htm;
}
error_log logs/error_www.abc.com.log error; (这是查看错误日志文件的位置)
}
3.nginx -t 检查一下Nginx是否有误,没报错后方可进行重启
service nginx restart 重启
4.然后运行页面 报错了直接进入错误日志中进行查看
直接 # vim logs/error_www.abc.com.log
二、https://blog.csdn.net/czlun/article/details/73251714
三、
如何快速找到php和Nginx的错误日志定位问题?
1. ps -ef | grep php 查看所在位置
( /usr/local/php/etc/php-fpm.conf)
2. cat /usr/local/php/etc/php-fpm.conf
error_log = /DATA/log/php/php_fpm.err 这个是php-fpm的错误日志
php_admin_value[error_log] = /DATA/log/php/php_errors.log 这个是php.ini的错误日志
3. ps -ef | grep nginx 查看Nginx所在的位置
/etc/nginx/nginx.conf
error_log /var/log/nginx/error.log; nginx 所在的错误日志
4.php --ini 查看php.ini所在的位置