I have written a CLI app in php. Apache is NOT involved in any way.
The app runs on Linux ubuntu 13.10 64bit. It will FTP a bunch of files, one at a time to another Linux ubuntu server.
php gives me a return code saying the FTP PUT failed on the large file. I realize that you want to look at the source code but I ask you to ignore it for a moment.
Why no source? Read my comments first:
- I have tried many sample programs off the net. They all give the same results
- If I FTP to a FTP server in the same building, the 900meg file transfers 100% ok (less than 1minute to transfer)
- If I FTP to a FTP server that is on the Internet, the 900meg file takes 45 minutes to transfer and PHP gives a failure return code.
- Even though PHP says the file transfer failed, I can gunzip the file and it appears to be fully transferred.
- We are both behind a NAT firewall and I am using PASV (as suggested in EVERY script that I have read)
- PHP 5.5.3-1ubuntu2.2 (cli) (built: Feb 28 2014 20:06:05)
I have some high level comments:
- Reading the source will not help because I think it is not an error in my script.
- Are there known bugs in FTP_PUT with PHP 5.5.3 ?
- If I move the server to the same subnet, it works. Over the slow internet, it falsely reports an error. Can this be due to the length of time that has elapsed? The max time limits of php seem to only apply to web apps, not CLI apps.
I think I am missing something really basic here.
FYI: It will FTP 4 files: 5megs, 11megs, 400megs, 900megs. All transfer ok based on file compares but the return code on the 900meg files says failed.
Any high level comments?