[php-src] Issue #23878: Add socket_timeout to file_get_contents
| From: | mokraemer | Date: | Thu, 24 Sep 2026 06:36:29 +0000 |
| Subject: | [php-src] Issue #23878: Add socket_timeout to file_get_contents | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252813@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/23878
Author: mokraemer
### Description
At the moment file_get_contents can only be set a read timeout via
$contextOptions['http']['timeout'], which is nice for long reads. In case the
server fails to connect or takes very long this option is not used at all.
In most cases the user needs an overall timeout, since it can break page loading.