phpstorm remote connection server development

phpstorm

phpstorm is a powerful ide editor With it, you can knock the code speed several times faster than with notepad ++ (not recommended for beginners ide, is recommended to use notepad ++), the disadvantage is no solid computer with up difficult (also there is not a solid computer ???)

Download the official website: https://www.jetbrains.com/phpstorm/

Do not ask me what this is connected: http://idea.lanyus.com/

phpstorm have a bunch of Sao operations such as git, svn version control, sftp, ftp, ssh, http client, the code track, breakpoints, theme custom ........

To find it on their own, we talk about things related to the development of swoole

 

VMware Virtual Machine

 

When you have no money to buy a server, virtual machine is the best choice (low with no computer on Human Rights)

Download: https://blog.csdn.net/fox_wayen/article/details/78439010  own Baidu Bar

 

CentOS

centos system is used with the virtual machine, if you have a server, you can safely ignore this virtual machine as well as content,

Download: link: https: //pan.baidu.com/s/1JyiIQO7onYUbwgM-L_Qp1A Password: uihi

 

phpstorm configured sftp

Before looking at this step, make sure you have a capable server (virtual machine) on the connector oh

1: Open phpstorm, create a test project

2: Click on the toolbar Tools => Deployment => Browser Remote Host:

Sin disabilities can blog

 

3: Click ... to configure sftp (ftp, etc., most of the linux server is not enabled by default sftp and ftp)

Sin disabilities can blog

4: Enter the server (virtual machine) ip, ssh port (default 22), account password

Sin disabilities can blog

 

5:点击mapping,配置Deployment  Path,这个目录将对应现在的项目目录,相当于项目中的文件,通过上传可直接上传到这个配置的目录

Sin disabilities can blog

 

6:勾选自动上传,每次修改完代码会自动上传到服务器(复制粘贴,composer 等非编辑器修改的文件不会被上传,需要手动)

Sin disabilities can blog

 

7:到这步的时候,我们已经可以和服务器的文件目录同步文件了,你在本地修改过的文件可以自动上传的服务器中,服务器修改过的你也可以手动下载下来,
然后我们开始配置ssh终端,点击Tools=>Start SSH session,选择刚刚已经配置好的sftp配置名,就可以开启一个ssh终端:

Sin disabilities can blog

 

Sin disabilities can blog

 

Sin disabilities can blog

 

 

8:接下来就可以在phpstorm 中使用ssh终端操作服务器(虚拟机)了

 

 

phpstorm配置php环境

如果想在phpstorm中运行服务器(虚拟机)的php环境,该怎么做呢?

1:首先确保你的linux服务器(虚拟机)有php环境(初学者建议宝塔,lnmp等集成环境)

2:点击File=>Settings

Sin disabilities can blog

3:点击Languages & Frameworks=>PHP,选择php language level(swoole4要求7.1以上),选择CLI Interpreter

Sin disabilities can blog

 

4:点击加号=>From docker,Vagrant,VM.我们用的是VM方式

Sin disabilities can blog

 

5:在之前我们已经配置好了一个sftp,可以直接勾选,如果你想换也可以直接换其他的:

Sin disabilities can blog

6:点击OK=>OK=>OK,

Sin disabilities can blog

 

7:新建文件test.php,写入echo 1;测试代码,右键上传(可配置自动上传,上面有讲到):

Sin disabilities can blog

 

8:右键点击 Run 'test.php(PHP Script)',即可运行成功:

Sin disabilities can blog

 

其他

通过以上教程,我们就可以完美的在windows下开发swoole了,上面的运行php代码只建议用于调试php,不建议用来开启swoole tcp服务器等,

Tcp open ssh server please use the terminal, a native command php server.php be open

Since cents disabilities can blog www.php20.cn

Guess you like

Origin www.cnblogs.com/aipiaoborensheng/p/11428820.html
Recommended