使用PHP 5.5安装xdebug [英] Installing xdebug with PHP 5.5

查看:119
本文介绍了使用PHP 5.5安装xdebug的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了很多答案,但无法弄清楚为什么xdebug不起作用.

I've read quite a lot answers but couldn't figure out why xdebug doesn't work.

php.ini:

[xdebug]
zend_extension="/usr/lib/php5/20090626/xdebug.so"

php -v:

PHP 5.5.6-1+debphp.org~precise+2 (cli) (built: Nov 21 2013 14:31:41) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies

/usr/lib/php5/20090626/xdebug.so确实存在. php.ini中没有zend优化器.

/usr/lib/php5/20090626/xdebug.so does exist. No zend optimizer in php.ini.

此外,如果我尝试安装xdebug:

Also if I try to install xdebug:

pecl/xdebug is already installed and is the same as the released version 2.2.3
install failed

谢谢.

推荐答案

好,所以我自己偶然发现了这个问题.

Ok so I've stumbled upon this myself.

首先,20090626库是为php 5.3编译的.因此,您不能真正使用它.这是我为了能够将xdebug与php 5.5一起使用而执行的步骤:

First of all, the 20090626 lib is compiled for php 5.3. So you can't really use that. Here are the steps I've performed in order to be able to use xdebug with php 5.5:

  1. 通过源. php> xdebug下载页面.
  2. 遵循此指南将您的源代码编译成lib.
  3. 因此,该扩展名位于正确的源文件夹中:20121212,您需要在配置中启用xdebug.
  4. 我正在使用ubuntu 12.04,因此后续步骤可能不适用于您的系统:

  1. Download the source via xdebug download page.
  2. Follow this guide for compiling your source into lib.
  3. So now the extension is in correct source folder: 20121212, and you need to enable xdebug in your config.
  4. I'm on ubuntu 12.04, so next steps might not work with your system:

  • 创建20-xdebug.ini配置并将其复制到/etc/php5/apache/conf.d和/etc/php5/cli/conf.d文件夹中(如果您计划在cli中使用xdebug的话) .在此处插入下一行代码:zend_extension=xdebug.so
  • 在apache2和cli php.ini配置文件中启用xdebug:
  • create 20-xdebug.ini config and copy it to both /etc/php5/apache/conf.d and /etc/php5/cli/conf.d folders (if you plan on using xdebug in your cli of course). Insert next line of code there: zend_extension=xdebug.so
  • enable xdebug in both apache2 and cli php.ini configuration files:

xdebug.remote_enable = 1
xdebug.renite_enable = 1
xdebug.max_nesting_level = 1000
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = '/var/log'

查看有关xdebug设置的更多信息: http://xdebug.org/docs/all_settings

See more about xdebug settings: http://xdebug.org/docs/all_settings

php -v:

PHP 5.5.7-1+sury.org~precise+1 (cli) (built: Dec 12 2013 21:37:40) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

这篇关于使用PHP 5.5安装xdebug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆