在Windows上和Linux上安装xdebug

来源:互联网 发布:冬天男鞋推荐知乎 编辑:程序博客网 时间:2024/06/05 22:53

        1、在Windows上安装。写个测试页,里面写上phpinfo();把内容复制贴到http://www.xdebug.org/find-binary.php页面里,点击提交,之后会提示本机php对应的Xdebug版本,下载后放到php目录下的ext目录内,再把下面的配置写入php.ini内,之后重启apache服务器,再刷新测试页面,看界面上是否有xdebug字样。

zend_extension="D:\server\php\php-5.3.8-Win32-VC9-x86\ext\php_xdebug-2.1.4-5.3-vc9.dll"    [Xdebug]    ;是否开启自动跟踪  xdebug.auto_trace = On  ;是否开启异常跟踪  xdebug.show_exception_trace = On  ;是否开启远程调试自动启动  xdebug.remote_autostart = On  ;是否开启远程调试  xdebug.remote_enable = On  ;允许调试的客户端IP    ;远程调试的端口(默认9000)  xdebug.remote_port=9001  ;调试插件dbgp  xdebug.remote_handler=dbgp  ;是否收集变量  xdebug.collect_vars = On  ;是否收集返回值  xdebug.collect_return = On  ;是否收集参数  xdebug.collect_params = On  ;跟踪输出路径  xdebug.trace_output_dir="c:\xdebug"  ;是否开启调试内容  xdebug.profiler_enable=On  ;调试输出路径  xdebug.profiler_output_dir="c:\xdebug"  xdebug.remote_host=localhost  




        2、在Linux上安装。

1、wget http://xdebug.org/files/xdebug-2.2.5.tgz2、tar -xzf xdebug-2.2.5.tgz3、cd xdebug-2.2.54、phpize5、./configure --enable-xdebug6、make && make install7、在php.ini里加入扩展        vim /etc/php.ini        extension=xdebug.so // 这里要注意了,若是重启php-fpm时有报这个扩展的warning,那么就得这么写了zend_extension=完整路径8、service php-fpm restart;9、写phpinfo测试页,看是否有xdebug项



0 0