在 CentOS 系统中,PHP 日志通常位于以下几个位置:
Apache 服务器:
/var/log/httpd/access_log/var/log/httpd/error_logNginx 服务器:
/var/log/nginx/access.log/var/log/nginx/error.logPHP-FPM:
/var/log/php-fpm/error.log要查看这些日志,你可以使用 cat、tail 或 less 等命令。例如:
查看 Apache 访问日志:
cat /var/log/httpd/access_log
实时查看 Apache 访问日志:
tail -f /var/log/httpd/access_log
查看 Nginx 错误日志:
cat /var/log/nginx/error.log
实时查看 PHP-FPM 错误日志:
tail -f /var/log/php-fpm/error.log
请注意,你可能需要 root 权限才能查看这些日志文件。如果你没有足够的权限,可以使用 sudo 命令:
sudo cat /var/log/httpd/access_log