以下是在Ubuntu上进行PHPStorm远程开发的设置步骤:
sudo apt update,然后sudo apt install openssh-server。sudo nano /etc/ssh/sshd_config,确保Port 22、PermitRootLogin prohibit-password、PasswordAuthentication yes未被注释,保存退出后sudo systemctl restart sshd。File -> Settings(或PhpStorm -> Preferences)。Languages & Frameworks -> PHP -> CLI Interpreter,点击右上角齿轮图标,选择Add。SSH Interpreter,输入远程服务器IP、用户名、密码或SSH密钥,点击Next,选择远程PHP解释器路径,完成添加。File -> Settings(或PhpStorm -> Preferences)中的Deployment -> Configuration。+按钮,选择SFTP(或FTP),填写服务器信息,设置本地与远程路径映射,点击Apply和OK。Run -> Edit Configurations,点击+选择PHP Remote Debug,配置调试端口、远程服务器IP等信息。php.ini中启用Xdebug并设置相关参数,如xdebug.remote_enable、xdebug.remote_host等。