linux安装xdebug

安装xdebug之前先搞清楚你的php与之对应的xdebug版本,这个新手还是要多多注意。
php -v 7.0.33
xdebug xdebug-2.5.5
直接下载 wget https://xdebug.org/files/xdebug-2.5.5.tgz
解压缩 tar -xvzf xdebug-2.5.5
进入文件夹 cd xdebug-2.5.5
运行 phpize(没有安装自行安装下)
之后
./configure --enable-xdebug --with-php-config=/你php的bin路径/php-config;
make
make install
运行成功后出现下面截图
linux安装xdebug
之后就出现一个问题了 据网上大多数教程是复制 /xdebug.so 到你指定的目录
cp modules/xdebug.so /你的php目录/xdebug
然后php.ini 加上下面几行代码
zend_extension =" 复制xdebug.so到的目录/xdebug.so"
xdebug.profiler_enable=on
xdebug.trace_output_dir=""
xdebug.profiler_output_dir=""
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
重启服务器还是不行,就可以在phpinfo()页面看到xdebug,但其实没有。
当初我也是卡在这里卡了一会儿。
但之后发现xdebug.so不用复制,在编译之后就已经存在了 ,查看 phpinfo页面中的extension_dir就可以发现xdebug.so 已经存在。
最后把zend_extension 的路径改为extension_dir 的路径就行了。
重启php,ok了!!!