László Monda
László Monda

Reputation: 1753

Truncated PHP-FPM / NGINX log lines

I have a lot of lines in my PHP-FPM / NGINX logs that are truncated to 2048 bytes like this:

2022/05/15 16:06:16 [error] 899#899: *29892 FastCGI sent in stderr: "com/wordpress/wp-includes/class-wp-query.php on line 4121PHP message: PHP Warning:  Attempt to read property "post_title" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-qu
ery.php on line 4123PHP message: PHP Warning:  Attempt to read property "post_name" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4125PHP message: PHP Warning:  Attempt to read property "ID" on null in /var/www/ultimateha
ckingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4121PHP message: PHP Warning:  Attempt to read property "post_title" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4123PHP message: PHP Warning:  Attempt 
to read property "post_name" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4125PHP message: PHP Warning:  Attempt to read property "ID" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-query.
php on line 4121PHP message: PHP Warning:  Attempt to read property "post_title" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4123PHP message: PHP Warning:  Attempt to read property "post_name" on null in /var/www/ultima
tehackingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4125PHP message: PHP Warning:  Attempt to read property "ID" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4121PHP message: PHP Warning:  Attempt to r
ead property "post_title" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-query.php on line 4123PHP message: PHP Warning:  Attempt to read property "post_name" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-includes/class-wp-qu
ery.php on line 4125PHP message: PHP Warning:  Attempt to read property "ID" on null in /var/www/ultimatehackingkeyboard.com/wordpress/wp-inclu

I've read many similar issues, and some people suggest recompiling NGINX, but I can't believe there's no other solution.

I've set the following options, which, to my knowledge, should solve the issue, but they don't:

Upvotes: 0

Views: 1890

Answers (2)

gud3
gud3

Reputation: 565

You can send error logs to stdout and log there with additional software.

www.conf

php_admin_value[error_log] = /dev/stdout
catch_workers_output = yes

Upvotes: 0

Sammitch
Sammitch

Reputation: 32262

You can change the logging settings in the config so that, instead of errors being printed to STDERR and percolating through the various intervening layers with their own constraints, the errors are written directly to a file by PHP.

The config directive is simply:

error_log = /path/to/file

Ref: https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-log

Upvotes: 4

Related Questions