tags:

views:

468

answers:

3

I use ftp_put / ftp_nb_put to upload files from my PHP server to another machine. I am frequently (90% of the time) getting absurd error messages like:

Warning: ftp_nb_put(): 2 matches total 
Warning: ftp_nb_put(): Transfer complete
Warning: ftp_nb_continue(): Opening BINARY mode data connection

Now errors like "no such directory" or "incorrect password" I could handle, but these "error message" seem to be completely pointless.

Google suggests this to be a Firewall/PASV-related problem. I have tried ftp_pasv(), but to no avail. I have contacted my server admin, but so far he hasn't come up with anything either.

A: 

This is not extremly helpful, but I also suggest that while you watch the php error log, open the ftp's in another window and try to figure out all things related. Most ftp servers have their own logfiles, or log to syslog.

Maybe you can replicate the environment with a vmware disk image, or in virtualbox (or similar) and debug this faster.

Till
+1  A: 

Well, since these are only warnings and you get the job done correctly, you can turn warnings off using ini_set() or altering php.ini This won't solve anything but you surely won't get the errors :)

Laodimos
A: 

The messages where symptoms of some arcane networking problems the server had. PHP does not diagnose such problems correctly and outputs seemingly random snippets from the communication between servers.

Not actually a programming question, rather a "server fault" issue (or rather a "get a better webhoster" issue).

jms