在Debian系统上进行PHPStorm远程调试,可按以下步骤操作:
sudo apt-get install php-xdebug
安装。/etc/php/7.x/cli/php.ini
中添加[xdebug]
配置段,设置zend_extension
为Xdebug扩展路径,xdebug.mode=debug
,xdebug.client_host
为本地IP,xdebug.client_port=9003
等。sudo systemctl restart apache2
或sudo systemctl restart nginx
。File > Settings > Languages & Frameworks > PHP
,点击CLI Interpreter旁的齿轮图标,选择Add
,选择SSH Interpreter
,输入服务器IP、用户名和密码,选择PHP可执行文件路径。Languages & Frameworks > PHP > Servers
中,点击+
添加服务器,设置主机名、端口、调试端口等,勾选Use path mappings
并设置本地与远程路径映射。Run > Start Listening for PHP Debug Connections
,在浏览器中访问项目URL即可开始调试。