You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SOAP HTTP socket not closing on object destruction #18990
If a SoapClient object is constructed without specifying the 'keep_alive' option to false, the socket never appears to be closed if it falls out of scope
The provided script should be able to reproduce this, you can check the open sockets by running the script like: "php /path/to/script.php &" and using the resulting PID on lsof -a -p {pid}
You should slowly see a list of TCP connections slowly build up over time similar to this:
If instead you were to add ['keep_alive' => false] as the options parameter on the SoapClient you'll see that the TCP connections don't appear to build up.
While I do understand the purpose of Keep Alive to keep a single connection open, I would assume this is still a bug as the SoapClient has gone out of scope and new SoapClient objects don't appear to reuse the existing connection and simply ignore it creating a new one.
File descriptors increase with each iteration of the loop:
Activity
ndossche commentedon Jul 1, 2025
I think you're right.
I think the culprit is this line:
php-src/ext/soap/php_http.c
Line 533 in 4a98b36
But I would need to double check after work.
Fix phpGH-18990, bug #81029, bug #47314: SOAP HTTP socket not closing…
Fix GH-18990, bug #81029, bug #47314: SOAP HTTP socket not closing on…
Merge branch 'PHP-8.3' into PHP-8.4
Merge branch 'PHP-8.4'