Home > Backend Development > PHP Tutorial > Where Can I Find My PHP Error Logs on a Shared Hosting Server?

Where Can I Find My PHP Error Logs on a Shared Hosting Server?

Patricia Arquette
Release: 2024-12-28 00:42:11
Original
416 people have browsed it

Where Can I Find My PHP Error Logs on a Shared Hosting Server?

Tracking Down PHP Error Logs in Shared Hosting Environments

In shared hosting setups where cPanel, Apache, and PHP are utilized via FastCGI, finding the PHP error log can be a challenge. Here's where to search and alternative methods to locate it:

Default PHP Error Log Location

  • If PHP is running as an Apache2 module, the error log is typically stored in /var/log/apache2.

Shared Hosting Log Files

  • Many shared hosts place log files in the root directory's /log subfolder. Search this location for the error_log file.

Customizing Log File Location

  • If you have access to the php.ini file, you can specify a custom log file location, such as:
error_log = /var/log/php-scripts.log
Copy after login

cPanel Error Log

  • According to rinogo's comment, the master error log file for cPanel is usually found at /usr/local/apache/logs/error_log by default.

Using phpinfo() to Find Log File Location

  • If all else fails, you can use the phpinfo() function to display the location of the PHP error log:
<?php phpinfo(); ?>
Copy after login

In summary, checking these locations and employing these techniques will assist you in finding the PHP error log, helping you troubleshoot errors effectively and maintain a smoothly functioning website.

The above is the detailed content of Where Can I Find My PHP Error Logs on a Shared Hosting Server?. 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