PHP 将错误日志存储在哪里?(PHP 5、Apache、FastCGI 和 cPanel)

本教程将介绍PHP 将错误日志存储在哪里?(PHP 5、Apache、FastCGI 和 cPanel)的处理方法,这篇教程是从别的地方看到的,然后加了一些国外程序员的疑问与解答,希望能对你有所帮助,好了,下面开始学习吧。

PHP 将错误日志存储在哪里?(PHP 5、Apache、FastCGI 和 cPanel) 教程 第1张

问题描述

I am on shared hosting and have cPanel, Apache, and PHP is run by FastCGI. Where does PHP store the error log?

Is there another way I can find the error log on a shared hosting environment instead of having to go through entire site structure to look for files?

I have access to the file (I am using PHP version 5.2.16).

解决方案

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 subfolder.
But...if you have access to a php.ini file you can do this:

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

/usr/local/apache/logs/error_log

If all else fails you can check the location of the log file using

<?php phpinfo(); ?>

好了关于PHP 将错误日志存储在哪里?(PHP 5、Apache、FastCGI 和 cPanel)的教程就到这里就结束了,希望趣模板源码网找到的这篇技术文章能帮助到大家,更多技术教程可以在站内搜索。