Where can I find error log files for PHP?

Better Stack Team
Updated on November 23, 2022

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 subdirectory. If you are using cPanel, the master log is stored in /usr/local/apache/logs/error_log.

You can change the log file location in the php.ini configuration file:

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

You can check the PHP configuration at any time by running the following PHP code:

 
<?php phpinfo(); ?>
Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

We are hiring.

Software is our way of making the world a tiny bit better. We build tools for the makers of tomorrow.

Explore all positions →