Welcome! Log In Create A New Profile

Advanced

PHP-FPM uses the fcgi socket to send raw log messages crashing nginx

Posted by Hannes Landeholm 
So basically I have a nginx/php-fpm setup that is basically a standard
install pulled directly from the ubuntu repository. When I just
die("test"); it works fine, the text loads in the web browser and when
I strace nginx I can see that php-fpm seem to be transferring valid
fcgi data. However as soon as I trigger some sort of error/notice/
whatever php-fpm will spew text-log messages into the fcgi-socket
making nginx crash with "502 bad gateway".

Also it might be worth noting that I upgraded to php 5.4 because the
php-fpm in 5.3 would segfault almost instantaneously.

This is an strace example (notice that the error is due to invalid
configuration that is easily fixed but any log/message/error will
trigger the same behavior):

connect(6, {sa_family=AF_FILE, path="/var/run/php-fpm.sock"}, 110) = 0
getsockopt(6, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
writev(6, [{"\1\1\0\1\0\10\0\0\0\1\0\0\0\0\0\0\1\4\0\1\3T\4\0\f
\0QUERY_STRING\16\3REQUEST_METHODGET\f\0CONTENT_TYPE\16\0CONTENT_LENGTH
\17\27SCRIPT_FILENAME/data/www/core/core.php\v\16SCRIPT_NAME/core/
core.php\v\1REQUEST_URI/\f\16DOCUMENT_URI/core/core.php\r
\tDOCUMENT_ROOT/data/www\17\10SERVER_PROTOCOLHTTP/
1.1\21\7GATEWAY_INTERFACECGI/1.1\17\fSERVER_SOFTWAREnginx/0.8.54\v
\tREMOTE_ADDR240.0.0.1\v\5REMOTE_PORT59202\v\vSERVER_ADDR240.0.0.194\v
\2SERVER_PORT80\v\0SERVER_NAME\17\3REDIRECT_STATUS200\toPHP_VALUE
\n display_errors On\n display_startup_errors On
\n "..., 896}], 1) = 896
epoll_wait(8, {{EPOLLIN|EPOLLOUT, {u32=748565025,
u64=139707444769313}}}, 512, 60000) = 1
gettimeofday({1334092529, 17977}, NULL) = 0
recvfrom(6, "ERROR: Passing INI directive through FastCGI: empty value
for key 'display_errors On'\nERROR: Passing INI directive through
FastCGI: empty value for key 'display_startup_errors On'\nERROR:
Passing INI directive through FastCGI: empty value for key
'error_reporting 30719'\n", 4096, 0, NULL, NULL) = 270

Thanks for your time,
Hannes Landeholm
Re: PHP-FPM uses the fcgi socket to send raw log messages crashing nginx
May 17, 2012 07:25PM
Were you ever able to resolve this issue? My project might be experiencing the same issue.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 139
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready