查找 Ubuntu 服务器上记录 PHP 错误的位置?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9168480/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Finding where PHP errors are logged on Ubuntu server?
提问by bsod99
I can't find the PHP error logs are on the ubuntu server.
我在 ubuntu 服务器上找不到 PHP 错误日志。
Checking phpinfo() has "no value" for error_log. If I run a locate error_log
I get nothing for the domain I am working with. This site is on a shared server, so I'm not sure I'll be able to change anything in php.ini -
检查 phpinfo() 对 error_log 没有“值”。如果我运行 a locate error_log
,则我正在使用的域将一无所获。该站点位于共享服务器上,所以我不确定我是否能够更改 php.ini 中的任何内容 -
Where are the PHP error logs?
PHP 错误日志在哪里?
回答by Cez
Check the main Apache error log for the host:
检查主机的主要 Apache 错误日志:
/var/log/apache2/error.log
/var/log/apache2/error.log
回答by webbiedave
This site is on a shared server
此站点位于共享服务器上
Then you need to ask your web hostwhere the log file(s) are located.
然后您需要询问您的网络主机日志文件所在的位置。
It's entirely up to them where and how each virtual host has its logs written.
每个虚拟主机在何处以及如何写入其日志完全取决于他们。
回答by drew010
Usually on shared servers where virtual hosts are concerned, each vhost has its own unique error_log
and access_log
files.
通常在共享服务器,其中虚拟主机而言,每个虚拟主机都有自己独特error_log
和access_log
文件。
On some hosts, these are typically in your home directory under a folder called logs. If you don't see any directory in your home that looks like it stores logs, log into your hosting control panel and see if you can get access to them there. For example, cPanel has a section called logs
, where you can find an item called Error Log
which would show you the contents of the Apache error log for your virtual host.
在某些主机上,它们通常位于名为 logs 的文件夹下的主目录中。如果您在家里没有看到任何看起来像存储日志的目录,请登录您的主机控制面板,看看您是否可以在那里访问它们。例如,cPanel 有一个名为 的部分logs
,您可以在其中找到一个名为的项目Error Log
,该项目将向您显示虚拟主机的 Apache 错误日志的内容。