以下是PhpStorm与Ubuntu共享文件的常见方法:
Ubuntu端配置
sudo apt update && sudo apt install openssh-serversudo systemctl start ssh && sudo systemctl enable sshPhpStorm端配置
File > Settings > Build, Execution, Deployment > Deployment+ 选择 SFTP,输入Ubuntu的IP、端口(默认22)、用户名及密码/密钥。Ubuntu端配置
sudo apt install samba/etc/samba/smb.conf,添加共享目录(如项目路径),设置权限和用户。sudo systemctl restart smbd。PhpStorm端配置
Ubuntu端
sudo apt install sshfssudo mkdir /mnt/remotesshfs user@ip:/path /mnt/remote。PhpStorm端
Settings > Version Control > SSHFS 中添加连接,选择挂载点路径。chmod -R 775 /path)。