PHP通过CLI成功地将错误记录到/var/log/php_errors.log。
但是apache + php不会记录错误。
[bla@notebook ~]$ apachectl -v
Server version: Apache/2.2.17 (Unix)
Server built: May 19 2011 03:15:39
[bla@notebook ~]$ php -v
PHP 5.3.6 with Suhosin-Patch (cli) (built: Mar 23 2011 13:28:00)
Copyright (c) 1997-2011 The PHP Group
Z
我正在尝试在一个非常简单的站点中安装log4php (试图了解它是如何工作的)。Apache安装在/etc/中,vhost定义为:
DocumentRoot "/home/fferri/workspace/site-tutorial/www" ServerName tutorial.localhost php\_value auto\_prepend\_file "/home/fferri/workspace/site-tutorial/www/ConfigureSite.php" My site is at /home/fferri/w
我试图猜测为什么在我的代码中执行一个不想要的操作。这是我的密码:
index.php
include_once("MyClass.php");
new MyClass();
MyClass.php
class MyClass{
private $LOG;
function __construct(){
require_once("Initializer.php");
$initializer = new Initializer();
$this->LOG = $initializer
我在码头容器中有php-fpm,在Dockerfile中,我编辑fpm配置文件(/etc/php5/fpm/pool.d/www.conf)以设置访问日志以转到/var/log/fpm-access.log,而错误日志设置为转到/var/log/fpm-php.www.log:
# Do some php-fpm config
# Redirect worker stdout and stderr into main error log
# Activate the fpm access log
# Enable display errors
# Enable the error lo
我遇到了一种奇怪的行为。我正在使用PHP运行NGINX。
当我在php.ini中启用PHP错误日志时
error_log = /var/www/logs/php-scripts.error.log
log_errors = on
错误日志按预期写入:
...
[15-Feb-2017 19:35:28 Etc/UTC] PHP Parse error: syntax error, unexpected end of file, expecting ',' or ';' in /var/www/html/index.php on line 7
但是,同时,在我的
我在我的亚马逊ec2 linux机器上运行php 5.5.20。我在终端中做了以下工作
[root]# cat /etc/php.ini | grep error_log
; server-specific log, STDERR, or a location specified by the error_log
; Set maximum length of log_errors. In error_log information about the source is
;error_log = php_errors.log
;error_log = syslog
error_log =