I am on shared hosting and have Cpanel, Apache, PHP is run by fastcgi. Where does PHP store the error log?
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?
I have access to the php.ini
(I am using PHP version 5.2.16).
On a LAMP environment the php errors are default directed to this below file.
All access logs come under:
Wordpress
Wordpress will direct
error_log()
messages to/wp-content/debug.log
whenWP_DEBUG_LOG
is set to true.See Wordpress Documentation for WP_DEBUG_LOG
Search the httpd.conf file for
ErrorLog
by runningcat <file location> | grep ErrorLog
on the command line. For example:Output:
Find the line that starts with
ErrorLog
and there's your answer.Note: For virtual hosts, you can edit the virtual hosts file
httpd-vhosts.conf
to specify a different log file location.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 aphp.ini
file you can do this:According to rinogo's comment: If you're using cPanel, the master log file you're probably looking for is stored (by default) at
If all else fails you can check the location of the log file using
When configuring your error log file in php.ini, you can use an absolute path or a relative path. A relative path will be resolved based on the location of the generating script, and you'll get a log file in each directory you have scripts in. If you want all your error messages to go to the same file, use an absolute path to the file.
See more here: http://www.php.net/manual/en/ref.errorfunc.php#53025
NGINX usually stores it in /var/log/nginx/error.log or access.log. (On Ubuntu in any case)