When using the ftp_puts or ftp_fputs, if you are receiving the error: ftp_put(): Illegal PORT command.
Here is the fix, use
//SET FTP TO PASSIVE MODE
I couldn't find any help on this so had to work it out for myself, so here it is for the rest of you guys :)
I guess PHP sets passive mode FALSE by default, you will only need to issue this command if the FTP server you are connecting requires you to do so, try it and see.