#124 file_get_html - Timeout

v1.0_(example)
open
nobody
None
1
2014-05-28
2013-03-22
Rob_M
No

When I connecting with $html = file_get_html("www.example.com") and server have opened port 80 but is busy, function file_get_html() is witing on and on and on.
file_get_html() not have a timeout.

Discussion

  • hlcb
    hlcb
    2014-05-28

    This kind of timeout error can be corrected are likely to increase the time limit using ini_set. Additionally, you may also need to include set_time_limit.

    ini_set( 'default_socket_timeout', 120 );
    set_time_limit( 120 );