PHP 7.2不再编写日志?

时间:2019-01-22 08:26:38

标签: php

从7.1升级到7.2后,PHP-FPM不写入日志。

在conf文件下面。环境是CentOS,Nginx。

;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 128M

; Set data paths to directories owned by process user
php_value[session.save_handler] = files
php_value[session.save_path]    = /var/lib/php/fpm/session
php_value[soap.wsdl_cache_dir]  = /var/lib/php/fpm/wsdlcache
;php_value[opcache.file_cache]  = /var/lib/php/fpm/opcache

1 个答案:

答案 0 :(得分:0)

www.conf

中进行这些设置
catch_workers_output = yes
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on

此外,别忘了创建一个日志文件,因此php-fpm可以在上面写:

touch /var/log/fpm-php.www.log && chmod 777 /var/log/fpm-php.www.log