I keep throwing this error but I have version 7.1.2 installed. Why can't I ./configure
Here is my error message:
checking whether to enable Xdebug support... yes, shared
checking Check for supported PHP versions... configure: error: not supported.
Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.3.10-1ubuntu3.26)
root#precise32:/var/www/xdebug# php -v
PHP 7.1.2-3+deb.sury.org~precise+1 (cli) (built: Feb 22 2017 10:29:40) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.2-3+deb.sury.org~precise+1, Copyright (c) 1999-2017, by Zend Technologies
root#precise32:/var/www/xdebug#
Has anyone else encountered this problem. I've tried reinstalling php 7.0 and several other tactics. Read through a bunch of different stack questions similar but I can't figure it out.
Which means I can't move on to: make
make install
cp modules/xdebug.so /etc/php.d/xdebug.so
You're using the PPA from Ondřej Surý. So you can easily install xdebug by using apt-get install php7.1-xdebug.
Edit: How-To configure Xdebug (on Ubuntu based Linux systems):
Create an ini file /etc/php/7.1/mods-available/custom.ini and put the following configuration into it:
; priority=90
[xdebug]
xdebug.remote_enable=1
; replace <Host-IP-Address> with the IP of your host system!
xdebug.remote_host=<Host-IP-Address>
; You'll need this later.
xdebug.idekey=PHPSTORM
xdebug.profiler_enable_trigger=1
Now activate the configuration with the command sudo phpenmod -v 7.1 -s ALL custom. Don't forget to restart your web server.
Second you need an IDE which supports the dbgp protocol. I use PhpStorm, it's fast (even it runs for hours) and of cause, it has a native Xdebug support.
After you've set up your IDE and set at least one breakpoint in your code, you can trigger the debugger very simple:
1st option: Add the query parameter XDEBUG_SESSION_START=PHPSTORM (where PHPSTORM is the value of the xdebug.idekey setting in your configuration file).
2nd option: Send a cookie with the content XDEBUG_SESSION=PHPSTORM with your request. cURL example: curl -H 'Cookie: XDEBUBG_SESSION=PHPSTORM' http://my-awesome.domain/awesome-script.php.
If you've set up anything correctly, you can now play with Xdebug.
Xdebug - Documentation
PhpStorm - Configuring Xdebug
PhpStorm - Zero-configuration Web Application Debugging with Xdebug and PhpStorm
And last but not least, some nice-to-have Xdebug settings:
; enable colors for the command-line interface
xdebug.cli_color=1
; show more data when using var_dump
xdebug.max_nesting_level=500
xdebug.var_display_max_children=512
xdebug.var_display_max_data=2560
xdebug.var_display_max_depth=200
; enable trigger for easy profiling
xdebug.profiler_enable_trigger=1
Have nice debugging sessions :)
Related
In my Laravel project using PhpStorm (2018.1) I am not able to debug my session using xdebug (2.9.5). Any breakpoint gets ignored and session ends without being paused. If I set Break at first line in PHP scripts then session stops at index.php file. I am using Ubuntu 20.04.
PHP 7.4.5 (cli) (built: Apr 23 2020 08:10:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v2.9.5, Copyright (c) 2002-2020, by Derick Rethans
This are my settings for xdebug in php.ini
[xdebug]
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9001
xdebug.remote_log="/tmp/xdebug.log"
I have some PhpStorm settings:
What am I missing here?
I also have Xdebug helper extension in my Chromium but it seems to have the same effect with it enabled as well as disabled.
In my Laravel project using PhpStorm (2018.1) I am not able to debug my session using xdebug (2.9.5).
It just triggered:
PhpStorm 2018.1
Xdebug 2.9.5
You have to upgrade PhpStorm. You need PhpStorm 2018.3 or newer in order to be able to work with Xdebug 2.7 or newer.
The problem is in changed XML namespace in Xdebug protocol, as of Xdebug 2.7 (https instead of http). It's fixed/supported since PhpStorm 2018.3 (see WI-43622).
With your current IDE version you may work with Xdebug 2.6.x max (which does not support PHP 7.4).
I am new to PHP. I want to enable Xdebug in Eclipse IDE but when I check Xdebug for my version https://xdebug.org/wizard.php showing error:- here is what
Tailored Installation Instructions
Summary
Xdebug installed: no
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC11 - Architecture: x86
Zend Server: no
PHP Version: 5.6.32
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\Windows
Configuration File: E:\xampp1\php\php.ini
Extensions directory: E:\xampp1\php\ext
PHP versions below 7.0 are not supported.
If you like Xdebug, and thinks it saves you time and money, please have a look at the donation page.
Please help to install Xdebug in Eclipse. I've installed XAMPP, Eclipse PDT PHP.
It seams your PHP Version is too low for xdebug:
Your PHP: "PHP Version: 5.6.32"
xDebug log said: "PHP versions below 7.0 are not supported."
So, after you upgrade you PHP version and successfully install xdebug, you should see (example):
# php -v
HP 7.2.3 (cli) (built: Mar 8 2018 10:30:06) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
with Zend OPcache v7.2.3, Copyright (c) 1999-2018, by Zend Technologies
I wanted to update this question because it is still possible to install XDebug against 5.6 and may still be necessary for legacy applications.
The wizard won't help you if you need to install XDebug for an older version of PHP (<7); you'll have to read the documents and work out the process yourself.
At https://derickrethans.nl/xdebug-php5.html the author states that the older source is available for downloading and using with older versions of php, and that 2.5 is the last version to work with PHP 5.6. You can download xdebug 2.5 from https://xdebug.org/download.php (or other versions as required).
The instructions on how to do this are on the XDebug website but maybe a little hard to grasp. A rough guide for installing installing on a CentOS 7.5 with Php 5.6 would be:
wgets https://xdebug.org/files/xdebug-2.5.5.tgz
tar -xvzf xdebug-2.6.0.tgz
cd xdebug-2.6.0
phpize [troubleshoot: yum install php-devel]
./configure --enable-xdebug
make
create a directory keep the xdebug module: mkdir /usr/php/xdebug/255
cp modules/xdebug.so /usr/php/xdebug/255
Find the active php.ini using php -i or phpinfo() in a script.
Restart the webserver: sudo service httpd restart
Make sure XDdebug is reported as enabled.
Edit php.ini: sudo nano /etc/php.ini
Add (or whatever your preferred options are) to php.ini:
zend_extension="/usr/php/xdebug/255/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_autostart = 1
xdebug.remote_port="9000"
xdebug.remote_connect_back=on
Configure your client to connect. I've had this working with vscode.
You can find more information at https://xdebug.org/docs/install.
I am trying to configure Xdebug on a local LAMP server with PHP 5.6 and Ubuntu 16.04 installed and am running into some difficulties. After first following the common installation directions: running "sudo apt install php-xdebug", modifying my php.ini to have the correct config, then restarting my apache server, I was not seeing Xdebug in my info.php (only the xdebug.ini that was being parsed in). When I run "sudo apt install php-xdebug" again however it would say that it was installed / up to date.
After trying a couple different things I was looking and saw that the new version of Xdebug no longer supports version lower than PHP 7, as such I saw what other versions were available by apt and purged the current Xdebug install I had in favor of running "sudo apt install php-xdebug=2.4.0-1" as I saw that version still supported older PHP versions. After this I still had the same issue however so I searched for similar issues.
I tried running "php -m" and "php5.6 -m" and both had different outputs but neither had Xdebug listed under Zend modules. Also ran "php --ini" and the output was
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
"php5.6 --ini" on the other hand outputs:
Failed loading /usr/lib/php/20131226/usr/lib/php/20131226/xdebug.so: /usr/lib/php/20131226/usr/lib/php/20131226/xdebug.so: cannot open shared object file: No such file or directory
Configuration File (php.ini) Path: /etc/php/5.6/cli
Loaded Configuration File: /etc/php/5.6/cli/php.ini
Scan for additional .ini files in: /etc/php/5.6/cli/conf.d
Additional .ini files parsed: /etc/php/5.6/cli/conf.d/10-mysqlnd.ini,
/etc/php/5.6/cli/conf.d/10-opcache.ini....
In case it helps here is the output for "php -v"
PHP 5.4.45 (cli) (built: Nov 15 2017 10:53:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
And "php5.6 -v"
PHP 5.6.34-1+ubuntu16.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
Not sure why "php -v" shows a different version of PHP and Zend Engine than "php5.6 -v" but figured it may be relevant to my issue. Anyways, I checked to make sure "xdebug.so" existed in that directory so I ran "locate xdebug.so"
/usr/lib/php/20131226/xdebug.so
/usr/lib/php/20151012/xdebug.so
In the "php5.6 --ini" output it was clear that some path was getting appended to the one I was adding in my /etc/php/5.6/cli/php.ini file, so I commented out
;zend_extension="usr/lib/php/20131226/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_enable = On
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
After doing that when I run "php5.6 --ini" I no longer get the failed loading error but still Xdebug is no where to be found / used. I used step 4 in Check if xdebug is working to check if it is installed properly and I always get call to undefined function so it's clear the installation is wrong. My end goal here is to get Xdebug set up so I can link it with Sublime but the first step is obviously just getting Xdebug installed on my server.
My hunch is it's something to do with my differences between php and php5.6? I've usually been able to get to the bottom of issues through hunting online but at this point I feel like I've tried most suggestions and genuinely don't know what I should do; my experience with these sort of issues is limited as well. Also https://xdebug.org/wizard.php doesn't help as it just says under PHP 7 isn't supported. Hopefully I've detailed everything I've tried so far, any help or things I could try would be greatly appreciated, also if I can provide any more details to figure this out just let me know.
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.
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:
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'
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
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.
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
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"
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.
To install a very specific version of Xdebug for a specific version of PHP you can do it by compilation from sources. E.g. if you would like to compile xdebug-2.5.5 for PHP 5.6 run following commands in console (Ubuntu):
sudo apt install php5.6-dev
cd ~/Downloads
wget "https://xdebug.org/files/xdebug-2.5.5.tgz" -O "xdebug-2.5.5.tgz"
tar -xzf xdebug-2.5.5.tgz
cd xdebug-2.5.5/
/usr/bin/phpize5.6
./configure --enable-xdebug --with-php-config=/usr/bin/php-config5.6
make
sudo make install
All available versions of Xdebug can be found here. Xdebug compilation guide is here.
I got the latest XAMPP package and extracted it at c:\tools php.exe -v gives following output
C:\tools\xampp\php>php.exe -v
PHP 5.3.5 (cli) (built: Jan 6 2011 17:54:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Eclipse PDT, I am using, has this version
Eclipse for PHP Developers
Version: Helios Service Release 2
Build id: 20110218-0911
Then I added ZendDebugger to eclipse from http://downloads.zend.com/pdt, so it created folder C:\tools\eclipse-php-helios-SR2-win32\plugins\org.zend.php.debug.debugger.win32.x86_5.3.18.v20100905\resources\php53
I modified php.ini { found in c:\tools\xampp\php } to setup ZendDebugger.dll
But no matter what I do, I am not able to debug my php web applications.
I get this error when I do "Test Debugger" from Eclipse
A timeout occured when the debug server attempted to connect to the following client hosts/IPs: -127.0.0.1
Then I came across this old post Installing Zend Debugger on Wamp/Windows Vista. Do I need to go back to old versions of php in order for zend debugger to work with Eclipse?
regards, Yogesh
xdebug is working in my case - so this should not be a problem related to php5.3 and xdebug.
For this I'd check the following things:
Is xdebug installed and enabled? (call phpinfo() to get more informations) If you can't find any informations xdebug is not installed.
Does xdebug stop the script if you call the php-function xdebug_break(); ?
xdebug needs a cookie to be activated. Is this cookie set by eclipse? Just try var_dump($_COOKIE)
Do you have this behaviour also if you try another environment? For example netbeans or phpstorm?
If the function xdebug_break() works but the script does not stop at breakpoints set in the IDE - I'd check if the dll-file for xdebug is included as zend_extension or extension. Xdebug has to be included as zend_extension for it has to be started before the parser of php is started!
Here's a good link to explain every step in it's detais. It's related to the IDE Komodo - but the installation of xdebug is the same:
http://docs.activestate.com/komodo/5.0/debugphp.html
Bye
Simon