PHP-FPM 白屏死机,未记录错误

Vic*_*Vic 2 php nginx php5 php-fpm

这是两个不同的 php 文件的故事。

文件 1 来源:

<?php $null->test();
Run Code Online (Sandbox Code Playgroud)

文件 1 输出:

致命错误:
在第 1 行的 /wwwroot/sites/example.com/public/fatal.php 中的非对象上调用成员函数 test()

这也打印到 /var/log/php-fpm/www-error.log (如我的 www.conf 中所定义)

文件2:

class A {}

function test(A $obj) {
    echo 'here...';
}

var_dump('started');
$a = new A();
test($a);

var_dump('this is going to error out');
test($null);

var_dump('do we get here?');
Run Code Online (Sandbox Code Playgroud)

文件 2 输出:

字符串 'started' (length=7)
here...
string 'this is going to error out' (length=26)

没有错误记录。

/etc/php-fpm.d/www.conf 中的相关设置:

catch_workers_output = yesphp_flag[display_errors] = on
php_flag[display_startup_errors] = on
php_admin_value[error_reporting] = 1
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
php_admin_value 128M

有任何想法吗?

cee*_*yoz 7

php_admin_value[error_reporting] = 1
Run Code Online (Sandbox Code Playgroud)

值为 1 表示E_ERROR仅类型错误。您的代码生成一个E_RECOVERABLE_ERROR.

http://www.php.net/manual/en/errorfunc.constants.php