Home > Article > Development Tools > How to configure phpstorm server
This article is written based on the official help documentation and my own practice. The reference document link is as follows:
https://confluence.jetbrains.com/display/PhpStorm/Deploying PHP applications with PhpStorm
The server I use is Apache, in fact, all servers The operation is the same. In specific applications, there are three situations:
1. The server is installed on the local computer, and the source files of our project are located in the file directory of the server, that is, the /htdocs directory.
2. The server is installed on the local computer. The source files of our project are in other folders on the computer. The project files need to be transferred to the file directory of the server for verification.
3. The server is not on the local computer. Our project source files are on the local computer. The project files are transferred to the file directory of the server through FTP, SFTP, FTPS or LAN.
Later in this article we will call them: Application 1, Application 2, Application 3.
Recommended tutorial: phpstrom installation and usage tutorial
First step
Open the dialog box shown below through Files|Settings|Deployment.
Click the green plus sign and the following dialog box will appear.
The name here can be chosen casually. For example, I named it "Apache". The selection of the "Type" option below is based on our application type. If it is application 1 , select "In place"; if it is application 2, select "Local or mounted folder"; if it is application 3, select according to your own file transfer method. Depending on the selection, the interface that appears later will be different. Of course, modifications can still be made in the next interface.
Step 2
If "Local or mounted folder" is selected for "Type" in the previous step, the following dialog box will appear. Appear.
As you can see, there are three tab areas to fill in: "Connection", "Mapping", and "Excluded Paths". When the selected "Type" is different, only the "Connection" part will be different. If the "Type" is "In place", then only the "Web server root URL" needs to be filled in. "Web server root URL", as the name suggests, is the root URL of the web server. If we have configured the domain name of the server in the hosts file, then the configured domain name can be written here.
Then you need to fill in the "Upload/download project files" section. First understand the concepts of Upload and Download.
Upload is copying data from the project TO the server, either local or remote. Download is copying data FROM the server to the project.
In other words, since the "Type" we selected is "Local or mounted folder" (i.e. Application 2), the project files need to be transferred to the server root file directory, so "Upload/download project files" What needs to be filled in is which directory we want to transfer the project to. Generally, we just fill in the /htdocs directory of the server.
The third step
In the previous step, we have completed the "Connection" part, and the next step is the "Mapping" part, as shown in the figure below Show.
"Local path": refers to the current directory of our project, which will be automatically generated and does not require us to fill it out.
“Deployment path on server ‘Apache’”: This is essentially a requirement to specify a more detailed “Upload/download project files” directory. Generally, a folder with the same name as the project file is most convenient.
“Web path on server ‘Apache’”: refers to the directory of the homepage php/html file.
The configuration work is completed here.
Step 4
Now you can upload the project to the web server as shown in the figure below. After uploading, we will A copy of the current project is found in the specified directory on the server.
The above describes a simple process for configuring the web server with PhpStorm. There are still many things not mentioned, so you need to refer to the documentation.
The above is the detailed content of How to configure phpstorm server. For more information, please follow other related articles on the PHP Chinese website!