在CentOS系统中,查看PHP错误日志的方法如下:
/var/log/php-fpm/
目录下,如error.log
文件,可使用tail -f /var/log/php-fpm/error.log
命令实时查看。/var/log/httpd/error_log
;若使用Nginx,则在/var/log/nginx/error.log
,查看命令分别为sudo tail -f /var/log/httpd/error_log
和sudo tail -f /var/log/nginx/error.log
。php.ini
、php-fpm.conf
等配置文件中的error_log
设置来确定日志文件位置。