Where are PHP logs stored?

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
Copied!

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

<?php phpinfo(); ?>
Copied!
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 →

Reliability is the
ultimate feature

Delightful observability tools that turn your logs & monitoring into a secret weapon for shipping better software faster.

Explore Better Stack