我在共享主机上并且有 cPanel、Apache 和 PHP 由 FastCGI.PHP 将错误日志存储在哪里?
I am on shared hosting and have cPanel, Apache, and PHP is run by FastCGI. Where does PHP store the error log?
是否有另一种方法可以在共享托管环境中找到错误日志,而不必遍历整个站点结构来查找 error_log 文件?
Is there another way I can find the error log on a shared hosting environment instead of having to go through entire site structure to look for error_log files?
我可以访问 php.ini 文件(我使用的是 PHP 5.2.16 版).
I have access to the php.ini file (I am using PHP version 5.2.16).
推荐答案如果 PHP 是 apache2 模块,PHP 会将错误日志存储在 /var/log/apache2 中.共享主机通常将日志文件存储在您的根目录 /log 子文件夹中.但是...如果您可以访问 php.ini 文件,您可以这样做:
PHP stores error logs in /var/log/apache2 if PHP is an apache2 module. Shared hosts are often storing log files in your root directory /log subfolder. But...if you have access to a php.ini file you can do this:
error_log = /var/log/php-scripts.log根据 rinogo 的评论:如果您使用的是 cPanel,则您可能要查找的主日志文件(默认情况下)存储在>
According to rinogo's comment: If you're using cPanel, the master log file you're probably looking for is stored (by default) at
/usr/local/apache/logs/error_log如果所有其他方法都失败了,您可以使用
If all else fails you can check the location of the log file using
<?php phpinfo(); ?>更多推荐
PHP 在哪里存储错误日志?(PHP 5、Apache、FastCGI 和 cPanel)
发布评论