Home > Backend Development > PHP Tutorial > Where Are My PHP Error Logs in a cPanel/Apache/FastCGI Environment?

Where Are My PHP Error Logs in a cPanel/Apache/FastCGI Environment?

Patricia Arquette
Release: 2024-12-19 14:30:14
Original
910 people have browsed it

Where Are My PHP Error Logs in a cPanel/Apache/FastCGI Environment?

Locating PHP Error Logs When Using PHP 5, Apache, FastCGI, and cPanel

In a shared hosting environment where PHP is operated by FastCGI with cPanel and Apache, the default location for PHP error logs is /var/log/apache2, assuming PHP is an Apache module.

Alternatively, shared hosting providers often store log files in a subfolder named /log in the root directory. However, if you have access to the php.ini file, you can specify a custom error log location by setting the "error_log" directive.

To check the current error log location, navigate to your php.ini file and look for the following line:

error_log = /var/log/php-scripts.log
Copy after login

Another possible location for the error log is /usr/local/apache/logs/error_log, as mentioned by rinogo in a comment.

If these methods do not yield the desired results, you can use the phpinfo() function to determine the error log location:

<?php phpinfo(); ?>
Copy after login

By searching the page output for "error_log," you should be able to identify the path to the error log file.

The above is the detailed content of Where Are My PHP Error Logs in a cPanel/Apache/FastCGI Environment?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template