Page 1 of 1

How to make an include timeout?

Posted: Sun Jan 12, 2003 5:45 pm
by Spinball
Hi,
I have 2 servers and need to interrogate data from the database on one server and display it on the other.
I do this by having a PHP file on the server with the required data which interrogates the database and writes HTML code using that data.
The other server then includes that PHP file.
It works fine except if the server with the database is down (or as today, intermittantly so). Then the include just seems to hang and the page doesn't load.
I tried using the set_time_limit function without success.
Is there a way to have the first @include fail after 10 seconds and the script continue?

Posted: Sun Jan 12, 2003 6:00 pm
by volka
The waiting url_wrapper is stucked in socket-select, which does not take cpu-time (at least negligible), therefor it seems that set_time_limit fails.
As of php 4.3 there is a configuration directive default_socket_timeout which might effect url_wrapper as well