By Guest on Tuesday, 17 June 2025
Posted in cPanel & WHM
Replies 2
Likes 0
Views 165
Votes 0
I am on shared hosting and have cPanel, Apache, and PHP is run by FastCGI. Where does PHP store the 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?

I have access to the php.ini file (I am using PHP version 5.2.16).
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

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(); ?>
·
1 week ago
·
0 Likes
·
0 Votes
·
0 Comments
·
#22
Linux
php --info | grep error

The terminal will output the error log location.

Windows
php --info | findstr /r /c:"error_log"

The command prompt will output the error log location.

To set the log location
Open your php.ini and add the following line:

error_log = /log/myCustomLog.log
·
1 week ago
·
0 Likes
·
0 Votes
·
1 Comments
·
#23
It is possible that php is not currently logging anything. If that's the case, you can open your php.ini, and set error_reporting to E_ALL & ~E_DEPRECATED & ~E_STRICT, or whatever errors you want to see, then set error_log to the path to the directory where you want your errors to get logged. (Note: this is not a full path to a file, just to a directory.)
1 week ago
#1
View Full Post