Phpstorm 远程同步代码(ftp,centos)

确保安装了FTP

使用命令 vsftpd -v 查看版本即可

安装FTP

centos 使用 yum -y install vsftpd 进行安装
mac可以使用brew ubuntu可以使用apt-get install

修改FTP配置

vi /etc/vsftpd/vsftpd.conf
以下是我的一些配置项,个人根据需要进行增减
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ascii_upload_enable=YES
ascii_download_enable=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

启动FTP

centos 启动FTP service vsftpd start/stop/restart

角色

如果机器已有角色忽略这步,没有需要添加一个
useradd your_role_name
passwd your_role_password

配置Phpstorm

首先找到Tools->Deployment


Phpstorm 远程同步代码(ftp,centos)_第1张图片
image.png

然后点击Configuration进行配置


Phpstorm 远程同步代码(ftp,centos)_第2张图片
image.png

点击下方的Advanced options,配置如下


Phpstorm 远程同步代码(ftp,centos)_第3张图片
image.png

OK之后再来配置Mappings


Phpstorm 远程同步代码(ftp,centos)_第4张图片
image.png

这部分配置完成后接着配置options


Phpstorm 远程同步代码(ftp,centos)_第5张图片
image.png

如下图修改配置使得每次代码的变更都实时ftp同步


Phpstorm 远程同步代码(ftp,centos)_第6张图片
image.png

提醒一下,这里配好后Phpstorm每次都是最小范围更新的,就是说你只改变一个文件的话,Phpstorm只FTP同步覆盖这一个文件到远程服务器,所以你需要在正式开始之前拷贝一份完整的本地代码到远程服务器的对应目录中,可以使用nc或者rsync

你可能感兴趣的:(Phpstorm 远程同步代码(ftp,centos))