10
votes

Would like to test the IDE PhpStorm to work with but I am already stuck at the importing process.. I am running a dev server with a Zend Framework 2 project I would like to add by ftp.

Everything look likes to be OK, I see the project created the whole structure of my application. When I am opening a file, the file is empty. I tried to hit "Download from here" at the menu of the remote system but I get the following message in my transfer console.

(just a couple of all files who failure)

[15-03-14 12:47] Failed to transfer file '/var/www/vhosts/dev.site.com/composer.json': could not read from "ftp://dev.site.com/composer.json" because it is a not a file.
[15-03-14 12:47] Failed to transfer file '/var/www/vhosts/dev.site.com/composer.lock': could not read from "ftp://dev.site.com/composer.lock" because it is a not a file.
[15-03-14 12:47] Failed to transfer file '/var/www/vhosts/dev.site.com/composer.phar': could not read from "ftp://dev.site.com/composer.phar" because it is a not a file.

What happens? It seems that the files are downloaded but not it's contents? permissions etc. are good, I can add/edit this project without any problem in Aptana or Zend Studio.

4

4 Answers

17
votes

Just try to enable "passive mode":

Tools -> Deployment -> Configuration -> Advanced options -> [FTP-server/FTP] -> enable "Passive mode" checkbox!

like at the screenshot: FTP-passive-mode-enabling

(my PHPStorm build is 139.1348)

That fixed my troubles with 'Failed to transfer file' using FTP.

6
votes

Fix for SFTP (there is no option to set passive mode for SFTP):

  1. Go to: File -> Settings -> Build, Execution, Deployment -> Deployment -> Options
  2. uncheck option "Preserve files timestamps".

Tested in PHPStorm build 2019.3.

3
votes

No real clue -- but happens randomly. For me personally happened only twice since v1 .. and both of them when transferring to Linux host (my usual deployment target is running on Windows platform, IIS FTP where I never seen such problem).

In any case -- known issue -- see this ticket for details: http://youtrack.jetbrains.com/issue/WI-6742

1
votes

the same issue happened to me, I enabled passive mode in phpstorm and it worked.

File=>Settings=>Build, Execution,Deployment=>Deployment=>conncetion=>Advanced options=>passive mode