This common theme appeared earlier, here , here , here , and undoubtedly, elsewhere on the Internet. In my case, unlike them, the hang comes from a blocking socket that never receives messages, and that is probably why the solutions described there did not work for me. I am developing in tandem a C ++ application that communicates with a php script through a local socket connection, and when the C ++ application fails, it leaves the PHP socket to the script waiting for a message that never appears. I tried using session_destroy and session_unset (calling them first in the script before session_start), but they do not work; even crashing and restarting the browser does not help. I can only stop the session if I delete session_start, reload the script, and then end the session through the client. How can I kill a session without going through it?
Edit: I forgot to mention, I also tried to split the socket using
socket_set_option($socket,0, SO_RCVTIMEO, array("sec"=>1, "usec"=>0));
But I got a βwrong operationβ error, and that didn't work.
Edit 2: setting a manual timeout following the prompt here worked quite well. I still donβt know how to kill a session, for example, stuck in an endless loop, but good.
source share