http://cct.me.ntut.edu.tw/chchting/aiahtm/computer/phphelp/function.ftp-pasv.php.htm
ftp_pasv() turns on passive mode if the pasv parameter is TRUE. It turns off passive mode if pasv is FALSE. In passive mode, data connections are initiated by the client, rather than by the server.
Returns TRUE on success or FALSE on failure.
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
ftp_pasv($ftp_resource,TRUE);