Re: problem in fopen

From: Date: Tue, 20 May 2003 07:49:03 +0000
Subject: Re: problem in fopen
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148256@lists.php.net to get a copy of this message
On Tuesday 20 May 2003 15:25, HPS wrote: > i tried to get some data from a remote website by using fopen(). > > $data_path = http://www.mysite.com/data.txt"; > $fp = @fopen ($data_path, "r"); > > The script works fine if the remove site (http://www.mysite.com/data.txt) > is up and accessible. > However, the script take a very long time to run if the server is down. > > Is it possible to add any time constraint in the script such that the > fopen() operation will abort, say, after 10 seconds ? > Or any alternative suggestion? Try changing default_socket_timeout. See manual > Filesystem functions for details. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* UNIX is hot. It's more than hot. It's steaming. It's quicksilver lightning with a laserbeam kicker. -- Michael Jay Tucker */

« previous php.general (#148256) next »