本文介绍了找出error_log的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个 domain.com 指向 /home/username/public_html/domain.com.

我将这些行添加到 .htaccess 文件中:

I added these lines to the .htaccess file:

ErrorDocument 500 /oohps.php
ErrorDocument 404 /where.php

所以我可以展示一些样式模板.

So I can show some styled template.

问题是当尝试访问一个不存在的页面时,我收到一个额外的内部服务器错误,所以这些文件没有打开.

The problem is that when trying to access a nonexisting page, I get an additional internal server error, so these files are not opened.

我想检查日志,但在该路径 (/home/username/public_html/domain.com) 中找不到错误日志.

I wanted to check for the logs, but I cannot find the error log in that path (/home/username/public_html/domain.com).

我在 /var/log/httpd 中找到了一个,但我认为它不是正确的文件夹,因为有很多错误与此页面无关,我没有看到任何相关.

I found one in /var/log/httpd, but I don't think it’s the right folder, because there are many errors not involved with this page and I didn't see any involved.

是否有 PHP 函数可以输出错误日志文件路径?

Is there a PHP function that would output the errors log file path?

推荐答案

内部服务器错误通常与 Apache/var/log/httpd/ 是 Apache 的错误日志文件,所以我认为你在正确的文件中.

An internal server error has often something to do with Apache and /var/log/httpd/ is the error log file of Apache, so I think you are in the right file.

错误路径在php.ini中设置.要获取路径,请使用 ini_get():

The error path is set in php.ini. To get the path use ini_get():

<?php
  $errorPath = ini_get('error_log');
?>

这篇关于找出error_log的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 05:26