下载xdebug地址,根据自己的PHP版本下载
xdebug下载地址 http://pecl.php.net/package/xdebug
下载完成后 ,解压 进入到目录
执行
- /usr/local/php7/bin/phpize
- ./configure --with-php-config=/usr/local/php7/bin/php-config
- make
- make install
- cp modules/xdebug.so /usr/local/php7/lib/php/extensions/no-debug-non-zts-20100525/
- 配置好php.ini 重启 service php7-fpm restart
[xdebug]
zend_extension="/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_connect_back=1
xdebug.remote_host=192.168.50.10
xdebug.remote_port=18931
xdebug.idekey="gaolaravel"
xdebug.remote_log="/data/xdebug7.log"
xdebug.collect_vars = 1
xdebug.collect_return = 1
xdebug.collect_params = 1
xdebug.remote_autostart = 1
xdebug.show_exception_trace = 1
啥也别说,先上图
进入File | Settings | Languages & Frameworks | PHP
上图
1.PHP版本,可自己定义填写,最好和自己的PHP版本保持一致,方便查看
2.选择PHP的安装位置,点击2后面的三个点点点进入选择界面
配置虚拟机信息
Mappings
3.path mappings
选择 File | Settings | Languages & Frameworks | PHP | Debug
进入 File | Settings | Languages & Frameworks | PHP | Debug | DBGp Proxy
进入 File | Settings | Languages & Frameworks | PHP | Servers
上图点击1打开监听,然后在代码中添加断点后,就可以点击 2 进行断点调试了
如果总是从入口文件开始调试,将如图位置勾选去掉 Break at first line in PHP scripts