How phpstorm implements the function of editing server code

不言
Release: 2023-04-03 09:10:01
Original
2638 people have browsed it

What I will share with you today is about the phpstorm editor. The main content of the introduction is how phpstorm implements the function of editing server code. Friends in need can refer to it.

phpstorm is a powerful editor that is loved by most coders and is also my most commonly used editor. Here is a lazy function. Use the sftp protocol to connect to the remote server to realize the function of directly editing the server code. The effect is that ctrl s can not only save local code, but also directly synchronize to the connected remote server. You can access it directly on the browser to view the code effect.

There are two methods: 1. There is no project locally, and the entire project needs to be pulled from the server. 2. There is already a project locally, and it needs to be connected with the server.

1 Pull server project

1Open phpstorm, click on the third entry and select web is on remote host... (The project is on the remote server.. .)

##2Fill in relevant information

a. Project name: Fill in the project name. Note that this name will be called this if there is no actual folder. This is displayed in phpstorm for your convenience.

b. Local directory: This is the location of the downloaded project, follow Usually, I install Thunder or Quickcast on my computer.

Just choose default for the one below.

3Add a new remote address

a. name: local project name, local project folder name

b. type: link method If it is a cloud server, you need to check the sftp link . If it is a virtual host, you need to use ftp link (the difference between sftp and ftp is attached)

c. host: remote server public network IP

d. port: ftp->21 sftp-> ;22

e. root path: This is the location of the remote project on your server (usually under the root directory home)

f. user name: Server login account name (the server is usually root The virtual host enters the host management system to check the official settings when purchasing the virtual host)

g. pass owrd: Server login account password

Just click below to complete

2 Connect the local project with Server association

Open your local project and find

Add a remote host address. After clicking the number, a pop-up box will appear. Enter a remote address that is easy to remember. Name

Add a new remote address

a. type: link method If it is a cloud server, you need to check the sftp link. If it is a virtual host, you need to use ftp link (the difference between sftp and ftp is attached)

b. host: remote server public network IP

c. port: ftp->21 sftp-> ;22

d. root path: This is the location of the remote project on your server (usually under the root directory home)

e. user name: Server login account name (the server is usually root The virtual host enters the host management system to check the official settings when purchasing the virtual host)

f. pass owrd: Server login account password

Then click the option Card mappings

3 The following is how to save settings and synchronize them directly to the cloudFind the settings window

##Selecting direct synchronization sometimes doesn’t work and you still need to press ctrl s. Try it yourself

The difference between FTP and SFTP

FTP is a file transfer protocol. On a website, if you want to share files with others, the most convenient way is to upload the files to an FTP server, and others can download the required files through an FTP client program.

FTP file transfer needs to be done through the port. The generally required ports are:

1. Control link—TCP port 21. controller side. Used to send instructions to the server and wait for the server's response.

2. Data link---TCP port 20. Data transfer port. Used to establish data transmission channels. It is mainly used to send a file from the client to the server, a file from the server to the client, and a file or directory list from the server to the client.

In order to adapt to different network environments, FTP supports two modes: active connection and passive connection. Both modes are mainly performed on the data link and have nothing to do with the control link.

Security risks of FTP:

1. FTP server software vulnerabilities.

2. Plain text password.

3. FTP flag.

4. Port scanning through the FTP server.

5. Data hijacking.

FTP security strategy:

1. Use a relatively secure system and FTP service software.

2. Use cipher text to transmit username and password.

3. Change the flag of the service software.

4. Strengthen protocol security.

SFTP is the abbreviation of Secure File Transfer Protocol and is a secure file transfer protocol. Provides a secure encryption method for transferring files. It has almost the same syntax and functions as ftp.

SFTP is part of SSH and is a secure way to transfer files to the Blogger server. It does not have a separate daemon itself, and the sshd daemon must be used to complete the corresponding connection operations, so in a sense, SFTP is not like a server program, but more like a client program. SFTP also uses encryption to transmit authentication information and transmitted data, so using SFTP is very safe. However, since this transmission method uses encryption/decryption technology, the transmission efficiency is much lower than ordinary FTP. Use it instead of FTP when higher network security requirements are required.

Related recommendations:

Solution to phpstorm editor garbled code problem, phpstorm editor garbled code

Code editor PHPstorm shortcut key summary

The above is the detailed content of How phpstorm implements the function of editing server code. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template