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

0x01 Xdebug安装

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

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/文件中html

0x02 XAMPP安装

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

直接下载安装便可。phpstorm

0x03 配置php.ini

在XAMPP中增长以下配置,注意zend_extension路径的配置:ide

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"spa

0x04 PhpStorm安装

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

0x05 插件的安装

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

0x06 配置PhpStrom

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

Debug配置:code

 

Tools->Deployment->Configuration配置:

0x07 结束

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

而后就能够开启调试了,若是访问路径出错,能够在Run->Edit Confiurations中修改URL路径

相关文章
相关标签/搜索