-1

I am trying to parsing HTML data from HTML file. I have a file which contains many links . I get those links and load them in file_get_contents($link) (I use simple_html_dom for all This stuff ) and want to find specific text in those link . It works great for three or five links after than I got fatal error: time exceeded 30 seconds in simple HTML Dom line 82 .

What are the problem I guessed ? Slow internet speed (that I can not increase) . PHP.INI file configuration Simplehtmldom configuration

What I tried but failed ?

I have edited max_execution_time to 0 and 300 but not worked after restart server (using local XAMPP server )

I also tried to edit simple_HTML_Dom.PHP but did not worked .

I do not know whether my server setting safe mode is on or not

Thank you , Actually we are group of college student trying to make a project.

4

2 回答 2

0

在 PHP.ini 中将 max_execution_time 设置为 0 是个坏主意,因为超时对于 Web 服务器来说是必不可少的。但是,为了方便耗时的脚本,您可以使用 ini_set('max_execution_time', 0) 临时设置 max_execution_time 的值。

将值放入脚本后,在脚本执行期间保留新值,并将在脚本结束时恢复。

于 2019-07-06T08:28:11.940 回答
0

我知道您尝试过设置max_execution_time,但您可以尝试ini_set直接在 PHP 脚本中使用:

ini_set('max_execution_time', 300);

也试试default_socket_timeout,这将改变file_get_contents函数的默认超时时间:

ini_set('default_socket_timeout', 300);
于 2019-07-06T08:13:29.373 回答