下載地址
https://xdebug.org/download.php
如不確定版本勺疼,可將phpinfo(),展示的信息全部復制放到
將下載的xdebug放入對應路徑
配置php.ini
在最后添加(IDEA也寫PHPSTORM)
[XDebug]
zend_extension="D:\PHP\PhpStudy\PHPTutorial\php\php-7.0.12-nts\ext\php_xdebug-2.6.0-7.0-vc14-nts.dll"
xdebug.idekey="PHPSTORM"
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = "req"
xdebug.remote_host=127.0.0.1
xdebug.remote_enable=on
xdebug.remote_port = 9001
xdebug.remote_autostart = yes
配置PHPstorm或IDEA
打上斷點杀狡,訪問當前頁面,debug成功
虛擬機Ubuntu內(nèi)裝docker的Xdebug配置
新建ext-xdebug.ini文件唧喉,放入路徑?/usr/local/php/etc/php.d/ext-xdebug.ini
文件內(nèi)容
[xdebug]
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
;xdebug擴展版本3.0以下版本配置
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.idekey="PHPSTORM"
xdebug.remote_autostart = yes
修改成主機的IP
xdebug.remote_host=192.168.50.111
;xdebug擴展版本3.0以上(包含)版本配置
xdebug.mode = develop,debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
xdebug.client_host = 192.168.50.111
xdebug.idekey="PHPSTORM"
重啟后即可