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

Where Can I Find My PHP Error Log on a Shared cPanel Server?

Mary-Kate Olsen
Release: 2024-12-30 21:05:15
Original
224 people have browsed it

Where Can I Find My PHP Error Log on a Shared cPanel Server?

Where Does PHP Store the Error Log in a Shared Hosting Environment? (PHP 5, Apache, FastCGI, and cPanel)

When running PHP on a shared hosting server with cPanel, Apache, and FastCGI, locating the error log can be challenging. Here's a comprehensive guide to help you find the error log effectively:

Default Location:

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

Root Directory:

  • Shared hosts often place log files in a subfolder named /log within the root directory of your website.

php.ini Configuration:

  • If you have access to the php.ini file, you can specify a custom location for the error log. To do this, add the following line:
error_log = /var/log/php-scripts.log
Copy after login

cPanel Master Log:

  • According to a comment by "rinogo," cPanel users can locate a master error log file (by default) at:
/usr/local/apache/logs/error_log
Copy after login

phpinfo() Function:

  • If you have access to your PHP site, you can use the phpinfo() function to display information about the PHP installation, including the error log file location.

Additional Tips:

  • If you are unable to find the error log in the default locations mentioned above, try searching your site structure for any files named "error_log" or "error_log.txt."
  • Some hosting providers may offer additional logging options within their control panel or user interface. Check with your hosting provider for specific instructions on accessing error logs.

The above is the detailed content of Where Can I Find My PHP Error Log on a Shared cPanel 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