Where is the PHP error_log located?
The PHP error_log file may be located in two possible locations, depending on when your account or domain was created. In recent cPanel versions, the error_log was moved from its default location of the path of execution to a single location for all PHP related error logging.
Global Account Location
Section titled “Global Account Location”The global account location for the error_log file is:
/home/username/logs/php.error.logWhere username is your cPanel username.
Legacy Execution Directory Error Log Location
Section titled “Legacy Execution Directory Error Log Location”For older cPanel versions, the error_log file was located where PHP was executed from. This means it was typically in the public_html directory for your primary domain:
/home/username/public_html/error_logAdditionally, for any additional domains or subdomains, the error_log file was located in the domain’s directory:
/home/username/domain.com/error_logWhere username is your cPanel username.
No error_log Found?
Section titled “No error_log Found?”If you don’t see an error log in either location, it’s possible that PHP error logging is not enabled for PHP or that directory. You can fix that by enabling log_errors using one of the following guides: