note 125369 deleted from soapclient.soapclient by crell
| From: | crell@php.net | Date: | Mon, 04 Apr 2022 16:51:41 +0000 |
| Subject: | note 125369 deleted from soapclient.soapclient by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218103@lists.php.net to get a copy of this message | ||
Note Submitter: t dot moser at moetech dot de
----
Note that the option "keep_alive" seems to be TRUE by default!
If you are having issues, for example getting the error:
"failed to open stream: Too many open files in"
When executing a multitude of soap requests using a new SoapClient per request will quickly lead to
this error.
What to do:
Add the option 'keep_alive' and set it to false!
<?php
$client = new SoapClient('/path/to/some.wsdl', ['keep_alive' => false,]);
?>
What NOT to do:
Increasing the amount of file streams that are allowed per process. This is just a work-around for
an issue that can easily solved, which will still keep the actual problem alive - the soap client
connections stay alive!