在Debian上使用PhpStorm进行文件共享,通常有以下几种方式:
File > Settings(或 PhpStorm > Preferences 在 macOS 上)。Deployment > Configuration。+ 添加新的服务器配置,选择 SFTP。sudo apt update
sudo apt install samba
sudo mkdir -p /var/www
/etc/samba/smb.conf,在最底部添加如下内容以定义新的共享区域:[SharedFolder]
path = /home/your_username/shared_folder
browsable = yes
writable = yes
guest ok = yes
read only = no
create mask = 0777
directory mask = 0777
your_username 为实际用户名。sudo systemctl restart smbd
sudo apt update
sudo apt install nfs-kernel-server
sudo mkdir -p /srv/nfs/shares
sudo chown nobody:nogroup /srv/nfs/shares
sudo chmod 0775 /srv/nfs/shares
/etc/exports 文件,例如:/srv/nfs/shares client-ip(rw,sync,no_subtree_check)
参数说明:
rw:读写操作sync:在应用更改之前,将更改写入磁盘no_subtree_check:禁用子树检查sudo exportfs -a
sudo ufw allow from client_ip to any port nfs
nfs-common 包:sudo apt install nfs-common
创建挂载点目录:
sudo mkdir -p /mnt/shared_nfs
挂载NFS共享:
sudo mount -a
/etc/fstab 文件:sudo nano /etc/fstab
添加以下内容:
client_ip:/srv/nfs/shares /mnt/shared_nfs nfs defaults,user,exec 0 0
参数说明:
client_ip:NFS 服务器的 IP 地址/srv/nfs/shares:来自 NFS 服务器的共享文件夹/mnt/shared_nfs:在客户端机器上挂载的目录nfs:nfs version 4defaults,user,exec:允许任何用户挂载文件系统,也允许他们执行二进制文件。以上就是在Debian系统上使用PhpStorm进行文件共享的几种方法。根据你的具体需求选择合适的方式进行操作即可。