Ubuntu-16.04安装Xdebug-2.2.5及相关介绍

Posted 山上小和尚

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu-16.04安装Xdebug-2.2.5及相关介绍相关的知识,希望对你有一定的参考价值。

Xdebug是一个开放源代码的php程序调试器(即一个Debug工具),可以用来跟踪,调试和分析PHP程序的运行状况。在日常开发中,我们会使用如 print_r() var_dump()等函数来进行调试,但毕竟Xdebug更加的专业,简单介绍下在Ubuntu-14.04下Xdebug-2.2.5的安装。

//闻海南PHP博客 http://blog.phpha.com
[email protected]:~$ wget http://www.xdebug.org/files/xdebug-2.2.5.tgz
[email protected]:~$ tar -zxf xdebug-2.2.5.tgz
[email protected]:~$ cd xdebug-2.2.5/
[email protected]:~/xdebug-2.2.5$ /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
[email protected]:~/xdebug-2.2.5$ ./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
[email protected]:~/xdebug-2.2.5$ sudo make
[email protected]:~/xdebug-2.2.5$ sudo make install
//闻海南PHP博客 http://blog.phpha.com
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-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博客 http://blog.phpha.com

以上已经成功安装了Xdebug扩展,接下来还需要我们对php.ini配置文件就行一些修改。

//闻海南PHP博客 http://blog.phpha.com
[email protected]:~$ sudo vim /usr/local/php/etc/php.ini
//添加以下配置选项,更多配置选项请自己借助查看官方说明
[Xdebug]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-zts-20121212/xdebug.so
xdebug.auto_trace = on
xdebug.default_enable = on
xdebug.auto_profile = on
xdebug.collect_params = on
xdebug.collect_return = on
xdebug.profiler_enable = on
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.trace_output_dir = "/usr/local/php/xdebug/"
xdebug.profiler_output_dir = "/usr/local/php/xdebug/"
//闻海南PHP博客 http://blog.phpha.com
//重启Apache
[email protected]:~$ sudo service apache restart

搞定安装完毕,开心ING,如果解决你的问题,就评论下呗

以上是关于Ubuntu-16.04安装Xdebug-2.2.5及相关介绍的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu 16.04 安装 phpmyadmin 404

ubuntu16.04快速安装LNMP

Ubuntu 16.04 安装 ssh

ubuntu16.04 安装 wxPython方法

安装Ubuntu16.04踩坑记录

Ubuntu16.04 + cuda8.0 + GTX1080安装教程