Title: Illegal PORT command
Last modified: November 1, 2017

---

# Illegal PORT command

 *  [mdsdigital](https://wordpress.org/support/users/mdsdigital/)
 * (@mdsdigital)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/illegal-port-command/)
 * When trying to use a CDN via FTP, we get the following error:
 * Error: Unable to upload file: /var/www/html/wp-content/cache/tmp/test_file_195c0b1f54a334929e2aae73f5dee456(
   ftp_put(): Illegal PORT command.).
 * Based on some posts, that would be fixed by enabling “Use passive FTP mode” or
   modifying one of the files to always use PASV mode. Neither of these options 
   has seemed to work.
 * Any workaround for this? Thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [mdsdigital](https://wordpress.org/support/users/mdsdigital/)
 * (@mdsdigital)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/illegal-port-command/#post-9670974)
 * For anyone that may have this issue.
 * We were able to solve the problem. Apparently, the plugin doesn’t swith to passive,
   even though it’s checked.
 * We had to edit the file CdnEngine_Ftp.php and add the following line right before
   the code starts any uploads (specifically, on lines #228 and #363:
 * @ftp_pasv( $this->_ftp, true );
 * As you can see from above, we’re hard coding the code to use always use passive,
   that would have to be modified to use passive based on the user selection on 
   the GUI.
 * Hope it helps someone!

Viewing 1 replies (of 1 total)

The topic ‘Illegal PORT command’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [cdn](https://wordpress.org/support/topic-tag/cdn/)
 * [ftp](https://wordpress.org/support/topic-tag/ftp/)

 * 1 reply
 * 1 participant
 * Last reply from: [mdsdigital](https://wordpress.org/support/users/mdsdigital/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/illegal-port-command/#post-9670974)
 * Status: not resolved