可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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 does exist. No zend optimizer in php.ini.
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
Thanks in advance.
回答1:
Ok so I've stumbled upon this myself.
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:
- Download the source via xdebug download page.
- Follow this guide for compiling your source into lib.
- So now the extension is in correct source folder: 20121212, and you need to enable xdebug in your config.
I'm on ubuntu 12.04, so next steps might not work with your system:
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
回答2:
Since this seems to bother more and more people trying to install xdebug via pecl here are the options:
- Windows: Get the binary
- Ubuntu (>12.04):
sudo apt-get install php5-xdebug
- Linux (other): via package manager or compile the latest source
Using PECL to install X-Debug for PHP5.5 as @Slayer Birden also answered will not work up to now and I don't think it will change in the near future.
回答3:
I had a similar problem on Ubuntu 14.10. I forgot to enable xdebug: sudo php5enmod xdebug
after installing xdebug from repository: sudo apt-get install php5-xdebug
Also do not forget to restart web server sudo service apache2 restart
My xdebug.ini looks like this: zend_extension=xdebug.so xdebug.remote_enable = 1
回答4:
I ran into this problem today. Found out that the latest version on download page might actually not work. Download the one under Xdebug 2.3.0, select "PHP 5.5 VC11 TS (32 bit) (MD5: ef4a8994cef26c47ac891d6872e391b3)". It worked for me. I tried ver 2.3.3 and 2.3.2 before which did not work.
回答5:
for xampp server first download xdebug and insert into php extention and edit php.ini file like this:
[XDebug] ; Only Zend OR (!) XDebug ; XAMPP and XAMPP Lite 1.7.0 and later come with a bundled xdebug at C:\xampp/php/ext/php_xdebug-2.3.1-5.5-vc11.dll, without a version number. xdebug.remote_enable=1 xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 ; Port number must match debugger port number in NetBeans IDE Tools > Options > PHP xdebug.remote_handler=dbgp xdebug.profiler_enable=1 xdebug.profiler_output_dir="C:\xampp\tmp" [PHP_XDEBUG-2.3.1-5.5-VC11] zend_extension="C:\xampp\php\ext\php_xdebug-2.3.1-5.5-vc11.dll"