PHP调试利器XDebug Mac下在phpstorm中的安装与使用
2018-03-23 21:16
721 查看
转载自:https://ifunbox.top/mac_php_xdebug_phpstorm_install
之前一直用比较原始的调试方法echo、print_r()、var_dump()、printf(),可能小项目比较小吧最近有时间,就研究了Mac系统下集成phpstorm的xdebug安装配置使用,下面记录一下~
2.配置xdebug在/usr/local/etc/php/5.6/conf.d/ext-xdebug.ini[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9001
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/Users/www/debug"
xdebug.idekey="PHPSTORM"3.在phpstorm中配置xdebug
上面都配置好后要在主菜单中,选择Run | Web Server Debug Validation.下图是验证成功的效果,但是没有那么顺利,报错Remote host is configured as “localhost” despite server host is probably not local,在stackoverflow有人说把xdebug.remote_host改成自己项目的域名就可以了,还真是不知道是为何。。。
4.phpstorm配置一个PHP Web Application
5.打开Chrome下载安装xdebug-helper,地址https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc点开选项记得把IDE key配置得跟之前设置的一样
到这里安装配置就结束了~~~
还有一个就是php报错的时候回显示堆栈信息
参考https://www.jetbrains.com/help/phpstorm/2016.2/configuring-xdebug.htmlhttp://stackoverflow.com/questions/36001918/phpstorm-xdebug-remote-host-is-configured-as-localhost-despite-server-host
之前一直用比较原始的调试方法echo、print_r()、var_dump()、printf(),可能小项目比较小吧最近有时间,就研究了Mac系统下集成phpstorm的xdebug安装配置使用,下面记录一下~
安装篇
1.xdebug的安装下载地址https://xdebug.org/我是直接用神器brew安装(版本号自行替换)brew install homebrew/php/php56-xdebug安装完毕后brew info homebrew/php/php56-xdebug 包含了很多信息 包括xdebug的配置文件路径,如何判断安装成功等等2.配置xdebug在/usr/local/etc/php/5.6/conf.d/ext-xdebug.ini[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9001
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/Users/www/debug"
xdebug.idekey="PHPSTORM"3.在phpstorm中配置xdebug
上面都配置好后要在主菜单中,选择Run | Web Server Debug Validation.下图是验证成功的效果,但是没有那么顺利,报错Remote host is configured as “localhost” despite server host is probably not local,在stackoverflow有人说把xdebug.remote_host改成自己项目的域名就可以了,还真是不知道是为何。。。
4.phpstorm配置一个PHP Web Application
5.打开Chrome下载安装xdebug-helper,地址https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc点开选项记得把IDE key配置得跟之前设置的一样
到这里安装配置就结束了~~~
使用篇
1.phpstorm 打开监听 Run | Start Listening For PHP Debug Connections2.打个断点3.访问项目域名,就可以在phpstorm中看到变量信息,点击红框,可以查看每次执行的代码行,也会看到因为执行代码行所赋值的变量。还有一个就是php报错的时候回显示堆栈信息
参考https://www.jetbrains.com/help/phpstorm/2016.2/configuring-xdebug.htmlhttp://stackoverflow.com/questions/36001918/phpstorm-xdebug-remote-host-is-configured-as-localhost-despite-server-host
相关文章推荐
- PHP调试利器XDebug的安装与使用
- PHP调试利器XDebug的安装与使用
- PHP调试利器XDebug的安装与使用
- PHP调试利器XDebug的安装与使用
- 【转】PHP调试利器XDebug的安装与使用
- PHP调试利器XDebug的安装与使用
- PHP调试利器XDebug的安装与使用
- 【转】PHP调试利器XDebug的安装与使用
- Mac环境下安装PHP及使用xdebug调试
- PHP - MAC下PhpStorm安装调试环境xdebug
- php 安装xdebug进行调试(phpstorm)
- Mac下PHP-XAMPP-PhpStorm-Xdebug断点调试配置
- Mac系统下使用自带Apache和php5.6使用xdebug进行调试
- 在PhpStorm中使用xdebug调试PHP代码
- mac下使用brew安装php的xdebug扩展
- 使用phpStorm编辑器进行PHP代码的xdebug调试
- PHPStorm设置xdebug工具调试php(使用浏览器或不使用浏览器两种方法)
- Php学习-使用PhpStorm、WampServer、Xdebug调试Web应用