您的位置:首页 > 运维架构 > Linux

在Windows上和Linux上安装xdebug

2015-07-14 18:04 603 查看
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.tgz 2、tar -xzf xdebug-2.2.5.tgz
3、cd xdebug-2.2.5
4、phpize
5、./configure --enable-xdebug
6、make && make install
7、在php.ini里加入扩展
        vim /etc/php.ini
        extension=xdebug.so // 这里要注意了,若是重启php-fpm时有报这个扩展的warning,那么就得这么写了zend_extension=完整路径
8、service php-fpm restart;
9、写phpinfo测试页,看是否有xdebug项


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: