Creating a Remote Server Configuration
On this page:
- Creating a Server Configuration: Specifying Its Name and Type
- Specifying User Credentials Defined during Registration on the Host
- Enabling connection to the Server and Specifying the Server Configuration Root
- Mapping Local Folders to Folders on the Server and the URL Addresses to Access Them
A remote server is a server on another computer (remote host).
To configure access to the server in this set-up, you need to specify the following:
- Connection settings: server host, port, and user credentials.
- The server configuration root folder and the URL address to access it.
- Correspondence between the project root folder, the folder on the server to copy the data from the project root folder to, and the URL address to access the copied data on the server. This correspondence is called mapping.
Creating a Server Configuration: Specifying Its Name and Type
Open the Deployment dialog box. Do one of the following:
- Open Settings / Preferences Dialog by choosing for Windows and Unix or for OS X, and click Deployment under Build, Execution, Deployment.
- Choose on the main menu.
- In the left-hand pane, that shows a list of all the existing server configurations, click the Add toolbar button . The Add Server dialog box opens.
Specify the server configuration name in the Name text box.
From the Type drop-down list, choose the server configuration type depending on the protocol you are going to use to exchange the data with the server.
- FTP: choose this option to have PhpStorm access the server via the FTP file transfer protocol.
- SFTP: choose this option to have PhpStorm access the server via the SFTP file transfer protocol.
- FTPS: choose this option to have PhpStorm access the server via the FTP file transfer protocol over SSL (the FTPS extension).
When editing the server configuration name in the Name text box, use the Up and Down keys on your keyboard to change the preselected server access to type in the Protocol drop-down list.
- Click OK. The Add Server dialog box closes and you return to the Connection tab of the Deployment dialog box.
Specifying User Credentials Defined during Registration on the Host
Specify the registration mode:
- To login in a regular mode, specify the login in the User name text box.
- To enable anonymous access to the server with your email address as password, select the Login as anonymous check box.
Specify the way to authenticate to the server:
- For FTP server, type your password and select the Save password check box to have PhpStorm remember it.
For SFTP server, choose the way to authenticate to the server. Do one of the following:
- To use standard authentication, choose Password, specify the password, and select the Save password check box to have PhpStorm remember it.
To use SSH authentication via a key pair, choose Key pair (OpenSSH).
To apply this authentication method, you need to have your private key on the client machine and your public key on the remote server you connect to. PhpStorm supports private keys generated using the OpenSSH utility. See http://wiki.qnap.com/wiki/How_To_Set_Up_Authorized_Keys for details.
Type the private key file and the passphrase in the corresponding text boxes.
For FTPS server, specify your user name and password and choose the security mechanism to apply.
- Choose Explicit to have the explicit (active) security applied. Immediately after establishing connection, the FTP client on your machine sends a command to the server to establish secure control connection through the default FTP port.
- Choose Implicit to have the implicit (passive) security applied. In this case, security is provided automatically upon establishing connection to the server which appoints a separate port for secure connections.
Enabling connection to the Server and Specifying the Server Configuration Root
Specify the host name of the FTP/SFTP/FTPS server to exchange data with and the port to which this server listens.
The default values are:
- 21 for FTP and FTPS
- 22 for SFTP
In the Root path text box,
specify the server configuration root relative to your user home which was defined when you registered your account.
This folder will be the highest one in the folder structure accessible through the current server configuration.
Do one of the following:
Accept the default value
/, which points at the user home folder on the server.
- Type the path manually.
- Click the Browse button and select the desired folder in the Choose Root Path dialog box that opens.
- Click the Autodetect button and have PhpStorm detect the user home folder settings on the FTP/SFTP server and set up the root path according to them. The button is only enabled when you have specified your user name and password.
- Accept the default value
In the Web server root URL text box, type the URL address to access 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.
Both the HTTP and the HTTPS protocols are supported.
To access a server through HTTPS, you need to acquire a certificate file
<certificate_name>.certsigned 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:
Open the embedded Terminal and type the following command:
If you are using the Oracle JRE bundled with PhpStorm, the default path to the truststore/keystore is
<jre_home>/bin/keytool.exe -importcert -keystore <path to jre truststore/keystore> -file <full_path_to_<cert_name>.cert>
Otherwise it is
When asked to enter a password for the truststore/keystore, specify the default one
PhpStorm.exe.vmoptionsfile in the
<PhpStorm_installation_folder>/binand add the following line to it:
-Djavax.net.ssl.keyStore=<path to keystore>
- Restart PhpStorm.
- Open the embedded Terminal and type the following command:
- Click the Open button to make sure that the specified URL address is accessible and points at the correct Web page.
Mapping Local Folders to Folders on the Server and the URL Addresses to Access Them
Configure mappings, that is, set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. The easiest way is to map the entire project root folder to a folder on the server, whereupon the project folder structure will be repeated on the server, provided that you have selected the Create Empty directories check box in the Options dialog box. For more details, see Customizing Upload/Download.