PhpStorm+XAMPP+Xdebug 集成开发和断点调试环境配置

0x01 Xdebug安装

参考:https://xdebug.org/docs/install

cd xdebug-2.5.4/
phpize
sudo ./configure --enable-xdebug
sudo make & make install

并把module/xdebug.so移到/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/文件中

0x02 XAMPP安装

参考:https://www.apachefriends.org/zh_cn/index.html

直接下载安装即可。

0x03 配置php.ini

在XAMPP中增加如下配置,注意zend_extension路径的配置:

zend_extension="/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.remote_log="/Applications/XAMPP/xamppfiles/logs/xdebug.log"
xdebug.idekey="PHPSTORM"

0x04 PhpStorm安装

参考:http://www.jetbrains.com/phpstorm/

0x05 插件的安装

Chrome中安装JetBrains IDE Support,Xdebug helper两个

0x06 配置PhpStrom

配置注意编译器的选择,File->Default Settings->PHP->Language&FrameWorks 中选择XAMPP的PHP

Debug配置:

 

Tools->Deployment->Configuration配置:

0x07 结束

记得Run菜单中选择Start Listening For PHP...,

然后就可以开启调试了,如果访问路径出错,可以在Run->Edit Confiurations中修改URL路径

posted @ 2017-08-25 22:59  vspiders  阅读(348)  评论(0编辑  收藏  举报