linux安装xdebug.(debian,ubuntu)

1: 首先还是下载

猛击这里下载xdebug-2.1.2.tgz

我下载到downloads目录. 在/home/yourName/Downloads/这里.


2:解压编译

cd 进去Downloads目录后  依次运行下面的命令

[php]  view plain copy
  1. tar -xvzf xdebug-2.1.2.tgz  

[php]  view plain copy
  1. cd xdebug-2.1.2  
[php]  view plain copy
  1. phpize  

(如果phpize没有这个command,需要安装一次phpize,phpize可以让php支持扩展模块.
[css]  view plain copy
  1. sudo apt-get install php5-dev  
这个过程有几分钟.主要是网速慢 - -)
[php]  view plain copy
  1. ./configure  
[php]  view plain copy
  1. make  
[php]  view plain copy
  1. make install  
会有这个界面
[php]  view plain copy
  1. See any operating system documentation about shared libraries for  
  2. more information, such as the ld(1) and ld.so(8) manual pages.  
  3. ----------------------------------------------------------------------  
  4. Installing shared extensions:     /usr/lib/php5/20090626+lfs/  
  5.   
  6.   
  7.   +----------------------------------------------------------------------+  
  8.   |                                                                      |  
  9.   |   INSTALLATION INSTRUCTIONS                                          |  
  10.   |   =========================                                          |  
  11.   |                                                                      |  
  12.   |   See http://xdebug.org/install.php#configure-php for instructions   |  
  13.   |   on how to enable Xdebug for PHP.                                   |  
  14.   |                                                                      |  
  15.   |   Documentation is available online as well:                         |  
  16.   |   - A list of all settings:  http://xdebug.org/docs-settings.php     |  
  17.   |   - A list of all functions: http://xdebug.org/docs-functions.php    |  
  18.   |   - Profiling instructions:  http://xdebug.org/docs-profiling2.php   |  
  19.   |   - Remote debugging:        http://xdebug.org/docs-debugger.php     |  
  20.   |                                                                      |  
  21.   |                                                                      |  
  22.   |   NOTE: Please disregard the message                                 |  
  23.   |       You should add "extension=xdebug.so" to php.ini                |  
  24.   |   that is emitted by the PECL installer. This does not work for      |  
  25.   |   Xdebug.                                                            |  
  26.   |                                                                      |  
  27.   +----------------------------------------------------------------------+  
如果make install出现失败,检查是否有权限.切换到root权限再执行
[php]  view plain copy
  1. su   
[php]  view plain copy
  1. ********  
[php]  view plain copy
  1. cp modules/xdebug.so /usr/lib/php5/20090626+lfs  
这里也是一样,如果cp出了问题,手动复制一下一样的.

3:编辑php.ini
终端
[php]  view plain copy
  1. gvim /etc/php5/apache5/php.ini  
添加
[php]  view plain copy
  1. zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so  
[php]  view plain copy
  1. zend_extension=/usr/lib/php5/20090626/xdebug.so  (debian)  
  2. xdebug.auto_trace = On  
  3. xdebug.show_exception_trace = On  
  4. xdebug.show_local_vars = On  
  5. xdebug.remote_autostart = On  
  6. xdebug.remote_enable = On  
  7. xdebug.collect_vars = On  
  8. xdebug.collect_return = On  
  9. xdebug.collect_params = On  
如果不能修改php.ini,切换下账户用root来修改.
重启apache
[php]  view plain copy
  1. sudo /etc/init.d/apache2 restart  

4:查看phpinfo
在最开头有zend那里出现
[php]  view plain copy
  1. This program makes use of the Zend Scripting Language Engine:  
  2. Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies  
  3.     with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans  
安装成功
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值