|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-08-22 10:25 UTC] fallingdust at gmail dot com
Description: ------------ --- From manual page: http://www.php.net/filesystem.configuration --- php.ini configuration: allow_url_fopen = On allow_url_include = Off ;from="john@doe.com" ;user_agent="PHP" default_socket_timeout = 60 ;auto_detect_line_endings = Off Test script: --------------- php -r 'ini_set("default_socket_timeout", -1); echo file_get_contents("http://www.google.com");' Expected result: ---------------- print the html of google page. Actual result: -------------- PHP Warning: file_get_contents(http://www.google.com): failed to open stream: Operation now in progress in Command line code on line 1 PHP Stack trace: PHP 1. {main}() Command line code:0 PHP 2. file_get_contents() Command line code:1 PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
I can confirm that with default_socket_timeout=-1, file_get_contents('http://www.google.com') succeeds, but file_get_contents('https://www.google.com') fails. Apparently, some code paths ignore negative timeouts by special casing them[1], and others don't. [1] <https://github.com/php/php-src/blob/PHP-7.3/main/network.c#L1243>