go to bug id or search bugs for
A UNIX socket connection is made using pfsockopen(). On the initial script entry, a message is sent to our server and the reply is correctly received by the script. On subsequent script entries, messages to the server are still sent successfully, but upon attempting to reply a SIGPIPE is received by server, and the php script receives a 0-length reply to its fgets() read.
We traced the problem to ext/standard/file.c, in the routine _file_socket_dtor(). In that routine, the macro SOCK_FCLOSE is used, which calls php_sock_close() in fsock.c. This routine correctly handles the persistent socket. However, after that call, _file_socket_dtor() then incorrectly calls the C routine shutdown(), which is what caused the problem. In fact, php_sock_close() already completely takes care of the shutdown() (for the non-persistent case), so in any event the shutdown() call in _file_socket_dtor() is not necessary.
Add a Patch
Add a Pull Request
pfsockopen() works for me with latest RC
Can you try with latest RC and see if it works
No feedback. Closing.