Centos 下php安装配置xdebug扩展

一、下载安装xdebugjavascript

获取xdebugphp

wget http://www.xdebug.org/files/xdebug-2.3.3.tgz

解压java

tar zxvf xdebug-2.3.3.tgz

进入解压模块服务器

cd xdebug-2.3.3

创建外挂模块spa

/usr/local/php/bin/phpize

配置xdebugdebug

./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config

编译安装调试

make && make install

按照上述步骤安装,若是没有什么特殊状况的话安装会顺利的进行,最后出现以下结果表示安装成功code

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
+----------------------------------------------------------------------+
  |                                                                      |
  |   INSTALLATION INSTRUCTIONS                                          |
  |   =========================                                          |
  |                                                                      |
  |   See http://xdebug.org/install.php#configure-php for instructions   |
  |   on how to enable Xdebug for PHP.                                   |
  |                                                                      |
  |   Documentation is available online as well:                         |
  |   - A list of all settings:  http://xdebug.org/docs-settings.php     |
  |   - A list of all functions: http://xdebug.org/docs-functions.php    |
  |   - Profiling instructions:  http://xdebug.org/docs-profiling2.php   |
  |   - Remote debugging:        http://xdebug.org/docs-debugger.php     |
  |                                                                      |
  |                                                                      |
  |   NOTE: Please disregard the message                                 |
  |       You should add "extension=xdebug.so" to php.ini                |
  |   that is emitted by the PECL installer. This does not work for      |
  |   Xdebug.                                                            |
  |                                                                      |
  +----------------------------------------------------------------------+

二、配置php支持xdebugblog

打开php.iniip

vi /usr/local/php/etc/php.ini

添加配置信息

zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
[Xdebug]
xdebug.remote_enable = 1   //开启远程调试
xdebug.remote_host = 192.168.17.90 //远程ip地址抑或是本机地址
xdebug.remote_port = 9000  //远程IDE服务器监听端口
xdebug.remote_handler=DBGP  //使用的协议

php脚本使用phpinfo()查看php的配置以下图,说明配置成功