基于lnmp.org的xdebug安装

1. 下载xdebug

wget http://xdebug.org/files/xdebug-2.2.0.tgz

2. 创建一个目录:

mkdir ./xdebug

3. 复制xdebug包到xdebug目录

cp xdebug-2.2.0.tgz --target-directory=./xdebug

4. 进入./xdebug 目录,  cd xdebug

5. 解压: tar -xzf xdebug-2.2.x.tgz 

6. cd xdebug-2.2.0

7. 执行: /usr/local/php/bin/phpize  

8. 执行:

./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

9. 成功后,会提示你:

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/

10. 打开php.ini

命令: vi /usr/local/php/etc/php.ini

在末尾添加:

[xDebug]
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so

 

然后重启:

/root/lnmp restart

 

在浏览器里面打开 http://192.168.0.7/phpinfo.php

看看xdebug是否已经加载了, 

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans

搞定

原文地址:https://www.cnblogs.com/moqiang02/p/4061254.html