|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-02-05 05:32 UTC] nickmc at codemasters dot com
I have a script which automatically transfers files to another single machine via FTP accross the Internet. The script was working fine on our old test server which was Win98 running Omnihttpd and PHP 4.0.6. However on the new server running Win2k Pro, IIS, and PHP 4.1.1 it causes problems. Connection fails and trying to use the connection results in a "Unable to find ftpbuf 0" error.
I have written a simple test script and have come to the following conclusions:
* ftp_connect() to localhost is fine
* ftp_connect() to local network IPs is fine
* ftp_connect() to Internet IPs doesn't work
Using FTP from the command line on the same 2k box to the same address works all of the time regardless of the destination IP.
$ip="ftp.geocities.com";
$conn_id = ftp_connect($ip);
print $ip."<br><br>";
if($conn_id) {
print "Connected OK";
}
else {
print "Unable to connect";
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
No, that's the not the same. FTP connections to internal network IPs and localhost work fine. I cannot connect to Internet IPs. $conn_id=ftp_connect("$FTPURL"); This always returns no connection, regardless of the (external)FTP site that I attempt to connect to. FTP through either DOS FTP or Explorer works without problems to any FTP site, regardless of its location. I can't work this out as PHP should connect in exactly the same way as any other app, unless of course there's some rediculously small timeout period and it's giving up before it connects.