Search code examples
phpstormubuntu-16.04vsftpd

PhpStorm vsftpd issue: 500 Illegal PORT command


I've setup an vsftpd on my Ubuntu 16.04 using this tutorial.

I can connect to server using FileZilla but not through PhpStorm. It issues this error when I try to upload a file to server:

Failed to transfer file 'C:\xampp\htdocs\sherkat\artisan.php': cant open output connection for file "ftps://SERVER-IP/artisan.php". Reason: "500 Illegal PORT command.".

and this is my config on PhpStorm

What's wrong with my config?


Solution

  • The FTP protocol supports two modes for the data connection. In the traditional mode, called "active" (which is the default), on each command sent by the client the server creates a connection back to the client and uses it to send the response. This is impossible on the most setups nowadays (actually, in the past 20+ years) because of firewalls.

    There is another mode, called "passive", where the data connection for the response is also initiated by the client. It works through firewalls without problems.

    Press the "Advanced options..." button, check the "Passive mode" option and you're good to go!


    As a side note, a better way is to use the SFTP protocol. If you can connect through SSH to your Ubuntu box, most probably you can also use SFTP to transfer files to it, without any other setup. FTP is an old and convoluted protocol. SFTP uses a secure connection (maybe it's not that important for you), and a simpler protocol.