一、下载xdebug
xdebug官网:https://xdebug.org/download.php
在选择下载哪个版本的xdebug的时候需要注意了,下面有两种方法,让你准确的下载自己环境对应的xdebug文件:
1>.打印出phpinfo()信息,如下:
然后还要注意一点就是看看自己php对应的版本和操作系统的位数,结合这四点去官网找到对应的xdebug文件(本人是php是7.0.1的版本,文件名:php_xdebug-2.6.0-7.0-vc14-x86_64.dll)
意思是在命令行执行 php -i 把内容复制进来进下下载编译安装
安装步骤
Download xdebug-2.9.6.tgz
Install the pre-requisites for compiling PHP extensions.
These packages are often called 'php-dev', or 'php-devel', 'automake' and 'autoconf'.
Unpack the downloaded file with tar -xvzf xdebug-2.9.6.tgz
Run: cd xdebug-2.9.6
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/extensions/no-debug-non-zts-20190902
Create /usr/local/etc/php/php.ini
and add the line
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
[Xdebug];xdebug配置
zend_extension="e:/php/ext/php_xdebug-2.2.1-5.4-vc9.dll";载入Xdebug
xdebug.profiler_enable=on
xdebug.trace_output_dir="e:/xdebug-log";xdebug的数据文件目录
xdebug.profiler_output_dir="e:/xdebug-log";xdebug的数据文件目录
xdebug.auto_trace=On;开启自动跟踪
xdebug.show_exception_trace=On;开启异常跟踪
xdebug.remote_autostart=Off;开启远程调试自动启动
xdebug.remote_enable=On;开启远程调试
xdebug.remote_handler=dbgp;用于zend studio远程调试的应用层通信协议
xdebug.remote_host=127.0.0.1;允许连接的zend studio的IP地址
xdebug.remote_port=9000;反向连接zend studio使用的端口
xdebug.collect_vars=On;收集变量
xdebug.collect_return=On;收集返回值
xdebug.collect_params=On;收集参数
xdebugbug.max_nesting_level=10000;如果设得太小,函数中有递归调用自身次数太多时会报超过最大嵌套数错