PhpStorm 2016.1 Help

Creating a Project from Downloaded Files

From time to time, you may need to update externally created and uploaded to a remote host with access through the FTP/SFTP/FTPS protocol, network share, or mounted drive. PhpStorm does not support direct editing of files on remote hosts. Therefore to work with remote sources in PhpStorm, you need to download them and arrange them in a PhpStorm project. To keep your local and remote or shared sources synchronized, you can configure automatic upload using the Upload changed files automatically to the default server drop-down list in the Options dialog box.

PhpStorm interacts with the remote host where the files are located according to a server access configuration. You can use an appropriate existing configuration or define a new one during project creation.

Creating a PhpStorm project around files from a remote host or accessible through network or mounted drive

  1. To start the New Project wizard, choose New Project from Existing Files on the main menu.
  2. On the Choose Your Scenario, page of the wizard, specify the method to access the files. Do one of the following:
    • To have PhpStorm download the remote files via network or from a mounted drive, choose Web server is on a remote host, files are accessible via network share or mounted drive.
    • To have PhpStorm download the remote files via the FTP, FTPS, or SFTP protocol, choose My web server is on a remote host, files are accessible via FTP/SFTP/FTPS.

    Click Next when ready.

  3. On the second, Specify Local Path, page of the wizard, specify the future location of the project on your computer and choose the download strategy to use:
    1. Appoint the parent folder to create the project folder in. Type the path to it manually in the Project local path text box or click the Browse button browseButton.png and select the desired location in the Select Path dialog box that opens.
    2. Specify the project name in the Project name text box. As you type, the name is added to the project path.
    3. Choose the download strategy in the Deployment options area.
    4. Click Next when ready.
  4. On the Add Remote Server page, create a server access configuration to enable interaction between PhpStorm and the remote host or mounted drive where the files are located, see Creating an in-Place Server Configuration for details.

    If you already have at least one server access configuration, PhpStorm brings you to the Specify Remote Server page. Just skip this step.

  5. On the Specify Remote Server page, choose the server access configuration according to which PhpStorm will interact with the remote host, see Creating an in-Place Server Configuration for details. Do one of the following:
    • To use an existing configuration, click the Use existing server option and select the configuration from the list. The list also shows the main access settings.
    • To define a new configuration, click the Add new remote server option and create the configuration, as described in the previous step. The Add Remote Server dialog box will open, when you click Next.

    To make sure that the specified URL address ensures successful connection to the server, clear the Don't check HTTP connection to server check box. Both the HTTP and the HTTPS protocols are supported.

    To access a server through HTTPS, you need to acquire a certificate file <certificate_name>.cert signed by a recognized authority and import this certificate in the truststore/keystore of the Oracle JRE (Java Runtime Environment) on which PhpStorm runs. Note that self-signed certificates are rejected as unsafe.

    To import a certificate in Oracle JRE:

    1. Open the embedded Terminal and type the following command:
      <jre_home>/bin/keytool.exe -importcert -keystore <path to jre truststore/keystore> -file <full_path_to_<cert_name>.cert>
      If you are using the Oracle JRE bundled with PhpStorm, the default path to the truststore/keystore is <%product_installation_folder>/jre/jre/lib/security/jssecacerts or <%product_installation_folder>/jre/jre/lib/security/cacerts.

      Otherwise it is <jre_home>/jre/lib/security/jssecacerts or <jre_home>/jre/lib/security/cacerts.

    2. When asked to enter a password for the truststore/keystore, specify the default one changeit.
    3. Open the PhpStorm.exe.vmoptions file in the <PhpStorm_installation_folder>/bin and add the following line to it:<path to keystore>
    4. Restart PhpStorm.
    Learn more at Java6 and Java7.

    If the Don't check HTTP connection to server check box is selected, PhpStorm moves to the next page of the Wizard without any connection check.

  6. On the Choose Remote Path page, configure the structure of the project to be created.

    The page shows a tree view of folders under the server configuration root ( The server configuration root is the highest folder in the file tree on the local or remote server accessible through the server configuration. For in-place servers, it is the project root. ).

    1. Specify which remote folder will become the project root. Select the relevant folder and click the icon_php_storm.png icon on the toolbar or choose Project Root on the context menu of the selection. PhpStorm marks the selected folder with the icon_php_storm icon.
    2. Under the project root, specify the folders that you do not need downloaded for some reason. These can be sources that you should not update at all, media, caches, temporary files, that you actually do not need in your work.

      Select the relevant folder and click icon_exclude_from_download.png or choose Exclude Path on the context menu of the selection.

      Exclusion is applied recursively. This means that if the selected folder contains subfolders they are automatically marked as excluded as well.

    3. Configure the folders under the project root. By default, all the files in this folder are treated as sources and are involved in indexing, searching, parsing, code completion, etc. To change this status, folders can be assigned to the following categories:

      Select the folder in question and assign the desired status to it:

      • To enable PhpStorm to complete relative paths to resources under the selected folder, click the Resource Root toolbar button rootResource.png or choose Resource Root on the context menu of the selection.
      • To have PhpStorm ignore the selected directory during indexing, parsing, code completion, etc., click the Excluded from Indexing toolbar button rootExcluded.gif or choose Excluded on the context menu of the selection.

      To return a folder to its regular status, select the folder in question in the list of folders under the content root, and click rootUnmark. Alternatively, select the folder in question in the tree and click the status icon once more.

      For more details, see Configuring folders under content roots and Excluding Files and Folders from Upload/Download.

See Also

Last modified: 12 July 2016