在Ubuntu查看PHP日志文件,可參考以下方法:
tail -f
命令實時查看,如查看Apache的PHP錯誤日志,可執行sudo tail -f /var/log/apache2/error.log
;查看PHP-FPM錯誤日志,執行sudo tail -f /var/log/php-fpm/error.log
。sudo vim /var/log/apache2/error.log
。sudo apt-get install goaccess
,再運行sudo goaccess /var/log/apache2/access.log -o report.html
查看實時日志并生成報告。