Forum Moderators: coopster
Eventually, it stops working and displays errors like "Warning: ftp_put(): PORT command successful", and "Warning: ftp_put(): Could not open data connection to port 61613: Connection refused".
I am running php V 4 on Mac OS X.3.9, and have tried activating passive mode with the same results.
Does anyone have any ideas that might make this work?
-Robur
if (!ftp_put($GLOBALS['ftpc'], $to, $from, FTP_BINARY)) $GLOBALS['copyErrors'] += 1;
I wonder if you aren't reaching a time limit or something. Try
set_time_limit [php.net](0);
Now I simply create a compressed tarball of the appropriate directory, using tar and gzip for windows, copy that 1 file across, then uncompress and untar on the server, and chown and chmod as required.
Loads faster and more reliable.
At the beginning of my script I open an ftp connection, store it in a global variable, use it for the rest of the script.
False Dawn:
That sounds like a good idea. I think it requires uploading a temporary php file to the remote site with an exec command inside it, then calling it with fopen(), then deleting it again. The only disadvantage is that the whole transfer has to start over if it gets interrupted. I will think about it...