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.
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.
file_get_html is a very limited function useful for quick tests, but not the best solution for real implementations. The solution @hlcb suggested is correct. Your current timeout is likely very high and makes the script wait for a very long time.
Of course, cURL provides much better support for customization.
Anyway, I'm closing this issue due to age.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
file_get_html
is a very limited function useful for quick tests, but not the best solution for real implementations. The solution @hlcb suggested is correct. Your current timeout is likely very high and makes the script wait for a very long time.Of course, cURL provides much better support for customization.
Anyway, I'm closing this issue due to age.