Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
561 views
in Technique[技术] by (71.8m points)

error-handling - PHP在哪里存储错误日志? (php5,apache,fastcgi,cpanel)(Where does PHP store the error log? (php5, apache, fastcgi, cpanel))

I am on shared hosting and have Cpanel, Apache, PHP is run by fastcgi.

(我在共享主机上,并由fastcgi运行Cpanel,Apache,PHP。)

Where does PHP store the error log?

(PHP在哪里存储错误日志?)

Is there any other way I can find the error log on shared hosting environment instead of having to go through entire site structure to look for error_log files?

(还有什么其他方法可以在共享主机环境中找到错误日志,而不必遍历整个站点结构来查找error_log文件?)

I have access to the php.ini (I am using PHP version 5.2.16).

(我可以访问php.ini (我使用的是PHP 5.2.16版)。)

  ask by PHPLOVER translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

PHP stores error logs in /var/log/apache2 if PHP is an apache2 module.

(如果PHP是apache2模块,则PHP将错误日志存储在/var/log/apache2 。)

Shared hosts are often storing log files in your root directory /log subfolder.

(共享主机通常将日志文件存储在根目录/log子文件夹中。)

But...if you have access to a php.ini file you can do this:

(但是...如果您有权访问php.ini文件,则可以执行以下操作:)

error_log = /var/log/php-scripts.log

According to rinogo 's comment: If you're using cPanel, the master log file you're probably looking for is stored (by default) at

(根据rinogo的评论:如果您使用的是cPanel,则您可能要查找的主日志文件(默认情况下)存储在)

/usr/local/apache/logs/error_log

If all else fails you can check the location of the log file using

(如果其他所有方法均失败,则可以使用以下命令检查日志文件的位置)

<?php phpinfo(); ?>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...