一、配置服务器段环境
1、如果没有安装phpize,先安装
yum -y install phpize
2、打开如下网站,下载对应php版本的xdebug
https://xdebug.org/download.php
3、下载后进入所在目录
cd xdebug-2.2.7/
4、开始编译安装
phpize
./configure --enable-xdebug
make
make install
5、配置php.ini文件,开启远程调试
zend_extension=/usr/lib64/php/modules/xdebug.so
;接收debug信息的主机地址
xdebug.remote_host=192.168.1.3
;模式
xdebug.remote_mode="req"
;端口
xdebug.remote_port=9000
;phpstorm远程调试key
xdebug.idekey="PHPSTORM"
xdebug.remote_enable=on
;自动启动,否则不能远程调试
xdebug.remote_autostart=1
;日志位置
xdebug.remote_log=/disk1/ans_workspace/xdebug.log
6、重启php-fpm
service php-fpm restart
二、配置phpstorm
1、打开phpstorm的配置页面参照图片设置