小编Vic*_*Vic的帖子

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 nginx php5 php-fpm

2
推荐指数
1
解决办法
4915
查看次数

标签 统计

nginx ×1

php ×1

php-fpm ×1

php5 ×1