【发布时间】:2012-05-01 10:40:54
【问题描述】:
我正在循环中使用file_get_contents() 方法调用一系列链接。每个链接的处理时间可能超过 15 分钟。现在,我担心PHP的file_get_contents()是否有超时时间?
如果是,它将超时并移至下一个链接。我不想在没有完成前一个链接的情况下调用下一个链接。
那么,请告诉我file_get_contents() 是否有超时时间。包含file_get_contents() 的文件设置为set_time_limit() 为零(无限制)。
【问题讨论】:
-
我在使用 PHP Tools for Visual Studio 扩展的 Visual Studio PHP 项目中遇到了相同的行为(在同一“服务器”上查询 URL 时超时)。 More information here.
-
在使用built-in PHP server to query an URL on the same website 时也会发生这种情况,因为它是单线程网络服务器。
标签: php timeout file-get-contents