fastcgi php nginx 错误日志搞砸了

fastcgi php nginx 错误日志搞砸了

我有一个奇怪的问题,我的 nginx 服务器的错误日志不知何故搞砸了:PHP 错误似乎全部写在一行中并递归地重复。这样,llog 在一天之内就增长了几 GB!

这是一条线在错误日志中:

2020/03/26 16:58:45 [error] 29816#29816: *32 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: SCRIPT_FILENAME in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 58PHP message: PHP Notice:  Undefined variable: pfad in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 60PHP message: PHP Notice:  Undefined offset: 1 in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 65PHP message: PHP Notice:  Undefined variable: benutzer in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 70PHP message: PHP Notice:  Undefined index: PATH_TRANSLATED in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 84PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on li

行数在 2048 个字符后被截断。

在这里,我在每个新错误之前分割了几行:


2020/03/26 16:58:45 [error] 29816#29816: *32 FastCGI sent in stderr: "
PHP message: PHP Notice:  Undefined variable: SCRIPT_FILENAME in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 58
PHP message: PHP Notice:  Undefined variable: pfad in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 60
PHP message: PHP Notice:  Undefined offset: 1 in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 65
PHP message: PHP Notice:  Undefined variable: benutzer in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 70
PHP message: PHP Notice:  Undefined index: PATH_TRANSLATED in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 84
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on line 96
PHP message: PHP Notice:  Undefined variable: localdir in /var/kunden/webs/my_web_app/www/pics/userpics/index.php on li

这可能是从哪里来的?我如何在 nginx 中定义标准错误报告?

答案1

看起来 nginx 与 fastcgi 捆绑了发生在一页消息中一行消息中的所有错误。

如果脚本有如此多的错误(可能是由于 PHP 升级),则该行将被截断为 2048 个字符。

相关内容