Tuesday, 17 June 2025
  2 Replies
  162 Visits
0
Votes
Undo
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).
1 week ago
·
#22
0
Votes
Undo
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
·
#23
0
Votes
Undo
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
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
© 2025 hostsocial.io