mac+phpstorm2020 + php7.4 +xdebug3 安装

xdebug 版本需要与php匹配,匹配地址 :https://xdebug.org/wizard.php

tips:不确定xdebug版本的,把phpinfo()的网页源代码全部复制到wizard.php页面的文本框中,点击Analyse my phpinfo() output 跳转到下载配置页面,按页面提示流程安装即可。

安装xdebug

1、点击匹配地址,把复制的phpinfo信息粘贴到文本框。

2、按照页面的安装流程安装xdebug。(是这个页面:https://xdebug.org/wizard,内容如下)

Download xdebug-3.1.3.tgz(https://xdebug.org/wizard.php 下载)
Install the pre-requisites for compiling PHP extensions.
On your Mac, we only support installations with 'homebrew', and brew install php && brew install autoconf should pull in the right packages.
Unpack the downloaded file with tar -xvzf xdebug-3.1.3.tgz
Run: cd xdebug-3.1.3
Run: phpize (See the FAQ if you don't have phpize).

As part of its output it should show:

Configuring for:
...
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/local/lib/php/pecl/20190902
Create /usr/local/etc/php/7.4/conf.d/99-xdebug.ini and add the line:
zend_extension = xdebug
Restart PHP-FPM```

3、配置php.ini

[Xdebug]
zend_extension=xdebug.so// 自己的路径
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1

;# 9003 is now the default (set this for old PhpStorm settings).
xdebug.client_port=9003```//xdebug3 默认端口

注意:xdebug3 配置已上面的配置为准
上面是安装完成,接下来就是配置phpstorm,我参考的两个网址:
1.https://cloud.tencent.com/developer/article/1468219
2.https://www.jianshu.com/p/3fe69df5d6de

猜你喜欢

转载自blog.csdn.net/m0_37678007/article/details/123601977