|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-12-27 13:28 UTC] david@php.net
fopen("http://my-url/","r") - Success
is the error returned. Attempting to use the filehandle return gives "is not a valid FileHandle resource", of course.
A "lynx -dump" from the server at the same time the error occurs shows that the url is fine and the connection to that web server is also fine.
Doesn't happen all the time, on every execution, but when it does happen is disastrous, any ideas? thanks.
PHP Version 4.0.3pl1
System Linux shell.eshirt.net 2.2.14 #3 SMP Sat Jan 8 23:22:14 EST 2000 i686 unknown
Build Date Oct 23 2000
Configure Command
'./configure' '--with-mysql' '--disable-debug' '--with-apxs=/www/bin/apxs'
'--with-config-file-path=/www/conf' '--enable-track-vars' '--with-gd=../gd-1.7.3'
'--with-ttf' '--enable-rule=EAPI' '--enable-versioning' '--with-swf=../dist'
Server API Apache
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
Warning: fopen("ftp://ftp.edome.net/mirror/seriously/general/wallpapers/samwallpaper9_800x600.zip", "r") - Success in /home/serioussam/cgi-bin/files/admin/functions.php on line 184 *groan* I get this error a lot, and it seems to be only from certain servers, only some of the time. It's really driving me and my site's users/admins crazy. Anyone know how to fix it? The file is obviously there, and it happens for more than one server. I'm running PHP 4.1.2.you can open a remote file with the fsockopen command I use this function when I had this problem /**********************************************************/ function sendToHost($host,$method,$path,$data,$useragent=0) { // Supply a default method of GET if the one passed was empty if (empty($method)) $method = 'GET'; $method = strtoupper($method); $fp = fsockopen($host,80); if ($method == 'GET') $path .= '?' . $data; fputs($fp, "$method $path HTTP/1.1\n"); fputs($fp, "Host: $host\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); fputs($fp, "Content-length: " . strlen($data) . "\n"); if ($useragent) fputs($fp, "User-Agent: MSIE\n"); fputs($fp, "Connection: close\n\n"); if ($method == 'POST') fputs($fp, $data); while (!feof($fp)) $buf .= fgets($fp,128); fclose($fp); return $buf; } /**********************************************************/