TypechoJoeTheme

Jim Tse

【PHP】PhpStorm+Xdebug调试

本文最后更新于2020年05月05日,已超过1598天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!

首先我php版本是5.6和7.2两个版本,php5.6下载的是xdebug2.5.5,php7.2使用Homebrew在Linux和macOS上通过PECL安装Xdebug,命令是

pecl install xdebug

Xdebug下载 可以根据自己php版本在官网下载对应的xdebug版本

解压

tar -xvzf xdebug-2.5.5.tgz

进入解压后的目录

cd xdebug-2.5.5

运行脚本生成 configure文件

phpize

安装与编译,--with-php-config目录后跟着自己php环境下的php-config文件路径

./configure --enable-xdebug --with-php-config=/opt/homebrew/opt/php@5.6/bin/php-config

make clean

make

make install

打开php.ini加入下面内容,里面没注释部分是xdebug2的配置,而;分号注释的配置是xdebug3以上版本的配置

xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_host= 127.0.0.1
xdebug.remote_port = 9003
xdebug.remote_autostart = On
xdebug.idekey = PHPSTORM
zend_extension="xdebug.so"
;xdebug.start_with_request = Yes
;xdebug.client_port=9003
;xdebug.mode=debug

重启php并按下面进行PhpStorm的xdebug配置


点击Debug进行测试

赞(0)
版权属于:

Jim Tse

本文链接:

https://jimtse.eu.org:88/program/php-xdebug.html(转载时请注明本文出处及文章链接)

评论 (0)