Search code examples
deploymentserverftpphpstorm

PhpStorm - debug on local, deploy on remote server


I'm working on a website using PhpStorm. For a long time I developed it locally, but then I got hosting and a remote ftp server.

I created a new project in PhpStorm with the settings for remote host, and I found that deploying code takes long time (over a minute) before I can see the result, which is quite uncomfortable when debugging.

Is there any possibility to work with code on a local server, and, when I think that the project is ready for deploy, just send it to the server.

I understand, that I can just work in two different projects and just deploy the "ready" version to server via FTP, but maybe there is some more comfortable way?


Solution

  • There is several answers to this question, and most of them opinion based but i will try and keep it objective.

    Case 1

    A big corporation gives every developer a sandbox, to test their code from, the corp requires every developer to keep their code on the sandbox. Using mounted drives could be extremely slow. Especially when PhpStorm is indexing.

    Case 2

    An easy way to keep an auto backup of your code it to use the build in (s)ftp(s) upload/deploy.

    Solution

    In both cases you could use the auto deploy feature that saves every changes to the server, that way the deploy doesn't take over a minute, but is usually already there before you know it.

    I cannot recommend to use the deployment for Production as it will not pass through your version control, SAT, security setups etc. In that case I would suggest something like rocketeer etc.

    EDIT:

    As for 2 projects, well you can define 2 different deployment servers, and use the default one for your testing, with auto upload or something, and then the other one can be selected from the deployment menu.