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

编程入门 行业动态 更新时间:2024-10-25 04:14:24
本文介绍了PHP 在哪里存储错误日志?(PHP 5、Apache、FastCGI 和 cPanel)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在共享主机上并且有 cPanel、Apache 和 PHP 由 FastCGI.PHP 将错误日志存储在哪里?

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

是否有另一种方法可以在共享托管环境中找到错误日志,而不必遍历整个站点结构来查找 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 error_log files?

我可以访问 php.ini 文件(我使用的是 PHP 5.2.16 版).

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

推荐答案

如果 PHP 是 apache2 模块,PHP 会将错误日志存储在 /var/log/apache2 中.共享主机通常将日志文件存储在您的根目录 /log 子文件夹中.但是...如果您可以访问 php.ini 文件,您可以这样做:

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

根据 rinogo 的评论:如果您使用的是 cPanel,则您可能要查找的主日志文件(默认情况下)存储在>

According to rinogo's comment: If you're using cPanel, the master log file you're probably looking for is stored (by default) at

/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)

本文发布于:2023-11-01 12:20:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549319.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   日志   PHP   cPanel   FastCGI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!