Create new PhpStorm project from remote server with automatic sync of source files

The following are the steps on how to create new PhpStorm project from your site's remote server:

  1. Open your PhpStorm program and click the "Create New Project from Existing Files" option:

    PhpStorm welcome window

  2. Select the option "Web server in on remote host, files are accessible via FTP/SFTP/FTPS" and click "Next" button:

    PhpStorm create new project from FTP

  3. Type your desired project name and click "Next" button:

    PhpStorm label the project

  4. Select "Add new remote server" and click "Next" button:

    PhpStorm add new remote server

  5. Type your desired name for the server; populate the FTP settings fields: "SFTP host"/"Port"/"Root path"/"User name"; select the applicable "Auth type" (in my case the server is using key pair authentication); provide the correct path for the private key file and key passphrase (if there's any) and click "Next" button:

    PhpStorm remote server settings

  6. This should show the folder structure of your root path. Select the folder where your site's root path is (in this case, there are no other folders present in the server), click the "Project Root" button, this will enable you to use the "Excluded from Download"/"Resource Root"/"Excluded from Indexing" to other folders present your file structure and click "Next" button:

    PhpStorm define server root folder

  7. Type the web path of your site (in this case, there is no sub-folder in able to access the site so I left it blank) and click "Finish" button:

    PhpStorm define server web path

    This will download all the files from your site's server to your local machine except for the folder(s) you've marked "Excluded from Download" from the previous step.

  8. Click "Tools" > "Deployment" > "Automatic Upload" to automatically save the source files changes you've made in PhpStorm to your site's remote server:

    PhpStorm Auto Sync

Using Xdebug with PhpStorm check this article.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.