Как настроить ftp phpstorm

Configure synchronization with a Web server

PhpStorm distinguishes among in-place , local , and remote servers, however the meaning of these terms in the context of PhpStorm slightly differs from their common meaning:

In the in-place server configuration, the web server is running on your computer, your project is under its document root (for example, in the /htdocs folder), and you do your development directly on the server.

The document root of an in-place server is the parent of the project root, either immediate or not. The document root is the web root or website root directory. Usually, it is the publicly-accessible base folder for a website.

In the local server configuration, you do your development, then copy the sources to the server.

A local server is a server that is running in a local or a mounted folder and whose document root is NOT the parent of the project root.

In the remote server configuration, a server runs on another computer (a remote host). To access files on the server, use FTP/SFTP/FTPS/WebDAV protocols.

Before you start

Synchronization with servers, uploading, downloading, and managing files on them are provided via the FTP/SFTP/WebDAV Connectivity bundled plugin, which is by default enabled. If the plugin is disabled, activate it in the Plugins page of the Settings dialog. For details, see Install plugins.

Server access configuration

PhpStorm controls interaction with web servers through server access configurations . Anytime you are going to use a server, you need to define a server access configuration, no matter whether your server is on a remote host or on your machine.

A server access configuration defines the following:

The server type ( in-place , local , or remote ).

The computer (host) where the server is running. For in-place and local servers, PhpStorm presupposes that it is the current computer where your project is.

The server access configuration root : the highest folder in the server hierarchy that can be accessed through the server configuration.

The URL address to access the server configuration root .

The protocol to transfer the data through and the connection parameters.

The correspondence between local folders (that is, the folders under the project root), destination folders on the server (either local or remote), and URL addresses to access the data on the server. This correspondence is called mapping .

For example, your project is stored under C:/Projects/My_Project/ and contains a folder C:/Projects/My_Project/My_Folder , while a local server has the document root under C:/xampp/htdocs . You upload the entire project tree to C:/xampp/htdocs/My_Project . In the PhpStorm terms, the C:/Projects/My_Project/My_Folder folder is referred to as local and the C:/xampp/htdocs/My_Project/My_Folder folder is referred to as remote .

You can define as many configurations as necessary, thus enabling flexible switching between upload/download setups.

If you need to deploy code to multiple servers, you can create a server group and avoid deploying to each server individually.

Default server access configuration

You can set a server configuration as default to have PhpStorm silently apply it in the following cases:

Manual upload and download of files without choosing the target host.

In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Build, Execution, Deployment | Deployment , select the required server access configuration in the central pane, and click on the toolbar.

Alternatively, click the Default Deployment Server widget in the PhpStorm status bar and select the desired server or server group from the popup menu.

To configure the upload to the default server, go to Build, Execution, Deployment | Deployment | Options .

Источник

Create New Project: Add Remote Server

The page opens if you have selected the Add new remote server option on the Create New Project: Specify Remote Server page. On this page, specify a new configuration of settings to connect and authenticate to a remote server.

In this field, type the name of the new remote server configuration.

FTP, FTPS, SFTP, WebDAV

In this list, choose the way to access the server. The available options are:

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).

WebDAV : choose this option to have PhpStorm access the server via the WebDAV file transfer protocol (the WebDAV extension).

Local or mounted folder : choose this option if the Web server is running in a local or a mounted folder and its document root is NOT the parent of the project root.

Читайте также:  Как настроить ручник на рено симбол

In place : choose this option if the Web server is running on your computer, your project is under its document root, and you do your development directly on the server.

FTP, FTPS, SFTP, WebDAV

In this field, specify the host name of the FTP/FTPS/WebDAV server to download the files from.

FTP, FTPS, WebDAV

In this field, specify the port to use. For FTP and FTPS, the default value is 21. For WebDAV, the default value is 6180.

FTP, FTPS, WebDAV

In this field, type your username for authentication to the server.

FTP, FTPS, WebDAV

Login as anonymous

Select this checkbox to enable anonymous access to the server.

FTP, FTPS, WebDAV

In this field, type your password for authentication to the server.

FTP, FTPS, WebDAV

Select this checkbox to have PhpStorm remember the specified password.

FTP, FTPS, WebDAV

From this list, choose one of the created SSH configurations, or click and create a new configuration as described in Create SSH configurations.

Click this button to check that the specified settings ensure successful connection via FTP/SFTP/FTPS/WebDAV.

FTP, FTPS, SFTP, WebDAV

In this field, specify the server configuration root relative to the root folder on the server. 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 / path, which points at the root folder on the server.

Type the path manually or click and select the desired folder in the Choose Root Path dialog that opens.

Click Autodetect . PhpStorm detects the user home folder settings on the FTP/SFTP server and sets up the root path according to them. The button is only enabled when you have specified your credentials.

FTP, FTPS, SFTP, WebDAV

In this field, specify the URL address of the Web server root folder. Click in the field to make sure that the specified server root URL address is accessible and points at the correct web page.

Both the HTTP and the HTTPS protocols are supported.

FTP, FTPS, SFTP, WebDAV

Click this button to have PhpStorm detect the user home folder settings on the FTP/SFTP/FTPS server and set up the root path according to them.

Expand this area to specify the additional uploading settings. The set of controls in the dialog depends on the server access type, for details, see Deployment: Connection Tab.

Choose the method to invoke client security:

Explicit : the explicit (active) security is 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.

Implicit : the implicit (passive) security is applied. In this case, security is provided automatically upon establishing connection to the server which appoints a separate port for secure connections.

Note that the Implicit method is considered deprecated, and using it is discouraged.

Don’t check HTTP connection to server

When this checkbox is cleared, PhpStorm checks whether the specified URL address ensures successful connection to the server.

Both the HTTP and the HTTPS protocols are supported.

When this checkbox is selected, PhpStorm moves to the next page of the Wizard without any connection check.

Источник

Deployment: Connection Tab

Use this tab to choose the way to access the Web server and specify the connection settings. The set of controls depends on the chosen server access type.

Common settings for all server types

Visible only for this project

Use this checkbox to configure the visibility of the server access configuration or server group.

Select the checkbox to restrict the use of the configuration or server group to the current project. Such configuration or server group cannot be reused outside the current project. It does not appear in the list of available configurations in other projects.

The server records are stored in the .idea directory together with the project, which allows sharing them between team members through a VCS.

In the server access configurations list in the left-hand pane, the configurations visible only in the current project are marked with the icon.

When the checkbox is cleared, the configuration or server group is visible in all PhpStorm projects. Its settings can be reused across several projects.

For details on setting up interpreters, see Configure remote PHP interpreters and Node.js via SSH.

In this list, choose the way to access the server. The available options are:

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.

Читайте также:  Как настроить дату время на хонор 7а

FTPS : choose this option to have PhpStorm access the server via the FTP file transfer protocol over SSL (the FTPS extension).

WebDAV : choose this option to have PhpStorm access the server via the WebDAV file transfer protocol (the WebDAV extension).

Local or mounted folder : choose this option if the Web server is running in a local or a mounted folder and its document root is NOT the parent of the project root.

In place : choose this option if the Web server is running on your computer, your project is under its document root, and you do your development directly on the server.

In this field, specify the Web server root folder URL address. Click in the field to make sure the specified server root URL address is accessible and points at the correct web page.

Both the HTTP and the HTTPS protocols are supported.

FTP and FTPS settings

In this field, specify the host name of the server to upload the files to.

In this field, specify the port to use. The default value is 21.

In this field, specify the server configuration root relative to the root folder on the server. 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 / path, which points at the root folder on the server.

Type the path manually or click and select the desired folder in the Choose Root Path dialog that opens.

Click Autodetect . PhpStorm detects the user home folder settings on the FTP/SFTP server and sets up the root path according to them. The button is only enabled when you have specified your credentials.

Click this button to have PhpStorm detect the user home folder settings on the server and set up the root path accordingly.

In this field, type your username for authentication to the server.

In this field, type your password for authentication to the server.

Login as anonymous

Select this checkbox to enable anonymous access to the server with your email address as password.

Select this checkbox to have PhpStorm remember the specified password.

Click this button to check that the specified settings ensure successful connection. The button is only enabled when you have specified your user credentials.

FTP and FTPS advanced settings

In the Advanced area, customize upload/download by specifying additional protocol-specific options for the FTP/FTPS server configurations.

Choose the method to invoke client security:

Explicit : the explicit (active) security is 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.

Implicit : the implicit (passive) security is applied. In this case, security is provided automatically upon establishing connection to the server which appoints a separate port for secure connections.

Note that the Implicit method is considered deprecated, and using it is discouraged.

Data channel protection level

From this list, set the protection level for the PROT command:

: the default server policy is applied.

Clear : raw data is transferred without applying security.

Private : the Transport Layer Security (TLS) or Secure Sockets Layer (SSL) applied.

For more information, see the articles on TLS, SSL 2.0, and SSL 3.0.

Reuse SSL session

Select this checkbox to connect to a server that requires SSL session reuse between the control and data connections.

Select to disable TLS 1.3 features and have PhpStorm fall back to connecting via TLS 1.2. Use this option if you experience issues with establishing a connection to a server or uploading certain files.

PhpStorm supports connecting to servers via TLS 1.2 and later. Using TLS 1.0 and TLS 1.1 is not supported, since these protocols are deprecated and considered insecure.

Select this checkbox to set the client on your machine to passive mode, when it connects to the server to inform about being in the passive mode, receives the port number to listen to, and established data connection through the port with the received number. This mode is helpful when your machine is behind a firewall.

Show and process hidden files

When this checkbox is selected:

Hidden files and directories are shown in the Remote Host Tool Window.

Hidden files and directories are involved in diff and synchronization operations.

The name of a hidden file or directory starts with a dot . .

Use LIST command

Use the options in this area to configure the LIST command usage.

Compatible with old version of listing children : Select this checkbox to ensure compatibility in child file naming with your FTP server.

This option is helpful if the remote FTP server reports the following error:

Читайте также:  Как настроить однобруску косилку

Selecting this option may slow down synchronization with the server.

Instead of MLSD : Select this checkbox to use the standard LIST command for listing instead of the MLSD command. This lets you avoid problems, for example, failure during upload with the Invalid descendent file name exception if the FTP server supports MLSD and returns cdir .

Number of connections

In this field, specify the maximum number of connections to be supported simultaneously.

Send keep alive messages each

In this field, specify how often you want PhpStorm to send commands to the server to reset the timeout and thus preserve the connection.

Keep alive command

From this list, choose the commands to be sent to the server to reset the timeout and thus preserve the connection.

Encoding for client-server communication

In this field, specify the encoding that matches the encoding used by your server. Accept the default value if you are not sure that it supports UTF-8 encoding.

SFTP settings

From this list, choose one of the created SSH configurations, or click and create a new configuration as described in Create SSH configurations.

Click this button to check that the specified settings ensure successful connection. The button is only enabled when you have specified your user credentials.

In this field, specify the server configuration root relative to the root folder on the server. 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 / path, which points at the root folder on the server.

Type the path manually or click and select the desired folder in the Choose Root Path dialog that opens.

Click Autodetect . PhpStorm detects the user home folder settings on the FTP/SFTP server and sets up the root path according to them. The button is only enabled when you have specified your credentials.

Use Rsync for download / upload / sync

Select this checkbox to use Rsync to synchronize your deployment configuration.

Rsync is used for upload and download operations. All other deployment-related operations, including accessing files on a remote host, comparing deployed files and folders with their local versions, and so on, are performed via SFTP.

Click this link to configure Rsync settings in the dialog that opens:

Provide the paths to the rsync and ssh executables.

On macOS and Linux, the rsync and ssh tools are preinstalled and their paths are filled automatically.

On Windows, you need to manually install Cygwin with the rsync and openssh packages first. The tools’ executables are commonly located in the \bin folder.

If necessary, override the Rsync command-line parameters in the Rsync options field.

By default, the -zar options are used, so that Rsync will compress the transferred data ( z ), preserve permissions, ownership, and timestamps of transferred files and folders ( a ), and recurse into subdirectories ( r ).

For the complete list of available options, refer to the Rsync documentation.

SFTP advanced settings

In the Advanced area, customize upload/download by specifying additional protocol-specific options for the SFTP server configurations.

Number of connections

In this field, specify the maximum number of connections to be supported simultaneously.

Send keep alive messages each

In this field, specify how often you want PhpStorm to send commands to the server to reset the timeout and thus preserve the connection.

For SFTP, this option is disabled. You can configure the keep alive interval for SFTP in the SSH Configurations settings.

Encoding for client-server communication

In this field, specify the encoding that matches the encoding used by your server. Accept the default value if you are not sure that it supports UTF-8 encoding.

WebDAV settings

In this field, specify the host name of the server to upload the files to.

In this field, specify the port to use. The default value is 6180.

In this field, type your username for authentication to the server.

In this field, type your password for authentication to the server.

Login as anonymous

Select this checkbox to enable anonymous access to the server.

Select this checkbox to have PhpStorm remember the specified password.

Click this button to check that the specified settings ensure successful connection.

Local or mounted folder settings

In this field, specify the server configuration root .

The server configuration root is the highest folder in the file tree on the server that can be accessed through the server configuration. The easiest way is to use the document root of your Web server as defined in the Web server configuration file. However you can appoint any other existing folder under the document root .

Источник

Поделиться с друзьями
Инструкции360