Error while installing Xdebug in PHP version 5.6.32 - php

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.

Related

xdebug - timeout error and failed to load error with v2.2.5 and v2.5.5 for php 5.2.6/xampp/zend

I am usign xampp. php version 5.6.28. Thread Safe. opcache disabled.
xdebug version that comes with xampp is 2.2.5
I am running xampp in Windows 10 Enterprise 64 bit.
INI Settings are
[xdebug]
zend_extension=php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
From the command line php -v I get
C:\Users\733283>php -v PHP 5.6.28 (cli) (built: Nov 9 2016 06:40:27)
Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright
(c) 1998-2016 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
When I ran the application by enabling xdebug I get session time out error in some line of php code. When I searched I got the following. https://bugs.xdebug.org/view.php?id=1424. It is mentioned that it has been fixed in xdebug version 2.5.4 . From their download page I downloaded the xdebug version php_xdebug-2.5.5-5.6-vc11-x86_64.dll for php version 5.6.2. (They have mentioned both 2.5.4 and 2.5.5 works with php 5.6.2). I copied to the ext folder and modified the php.ini file as
zend_extension = php_xdebug-2.5.5-5.6-vc11-x86_64.dll
I tested this by running php -v from the command line. I got the following.
C:\Users\733283>php -v
Failed loading C:\xampp\php\ext\php_xdebug-2.5.5-5.6-vc11-x86_64.dll
PHP 5.6.28 (cli) (built: Nov 9 2016 06:40:27)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
When I tried their https://xdebug.org/docs/install I can see for php 5.6 the versions of xdebug 2.5 and 2.4 are mentioned. I tried both but got the same above output.
When I tried their testing page it says
Tailored Installation Instructions
Summary
Xdebug installed: no
Server API: Command Line Interface
Windows: yes - Compiler: MS VC11 - Architecture: x86
Zend Server: no
PHP Version: 5.6.28
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: yes
OPcache Loaded: no
Configuration File Path: C:\WINDOWS
Configuration File: C:\xampp\php\php.ini
Extensions directory: C:\xampp\php\ext
PHP version 5.6 is not supported.
But their install page says xdebug version 2.5 works with php v5.6
I have also raised a issue in their website. https://bugs.xdebug.org/view.php?id=1678.
How to make it work?

PHP Xdebug not in php

hi i install homebrew install some brew things and now i need install Xdebug but when i write to terminal on mac php --version there is only version of php not version php with xdebug only version of php
$ php --version
PHP 7.2.8 (cli) (built: Aug 28 2018 16:32:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
help me i doo all things what i should but it not work correctly help thx
With the migration to Homebrew-core the php formula has stopped taking over the role of PECL. Installing xdebug can (and should) be done through PECL (https://pecl.php.net/package/xdebug).
pecl update-channels
pecl list-all
pecl install xdebug
or upgrade it
pecl upgrade xdebug
After that you'd need to update your php.ini with a line to specify xdebug's location, as suggested on xdebug.org:
zend_extension="/usr/local/php/modules/xdebug.so"
Additionally, you may need to put in there some settings for xdebug, for example:
xdebug.collect_vars=1
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_port=9005
Source: http://www.artemdwo.com/install-php72-and-xdebug-on-mac-os-x

Why is php zip extension not working on ubuntu though it's installed?

I'm on Ubuntu 16.04 and I'm trying to install prestashop e-commerce CMS that requires php zip extension to unzip the main CMS folder.
I have installed php-zip and php7.2-zip and I also restarted the web server (apache2) but the CMS still displays the following message
An error has occured:
You must install PHP zip extension first
Here's the result of my installed php zip packages and my current php version:
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ php -v
PHP 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 5 2018 04:59:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ apt list --installed | grep php | grep zip
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
php-zip/xenial,xenial,now 1:7.2+60+ubuntu16.04.1+deb.sury.org+1 all [installé]
php7.2-zip/xenial,now 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
I spent an hour and a half trying to figure out whether I need to activate the extestion on the php.ini file and also installing and reinstalling and restarting the web server but nothing seems to work.
I have tried a few solutions on the web that used to work for me but I can't seem to find a good solution.
Please help me with your experience!
I've found the solution after I printed the results of the phpinfo() function.
It seems that the version of php printed with the "php -v" command is not the version that actually apache is using. Apache ended up using the 7.0 version.
Thanks everyone.

Where do I tell Apache to use 5.6.23 instead of 5.5.9?

I am having a problem AFTER installing a newer version of PHP with the Apache web server seeing the new version 5.6.23...it is still using 5.5.9. Where do I tell Apache to use 5.6.23 instead of 5.5.9?
I am running a local web server on Linux Mint 17.1
As reported by phpinfo (both BEFORE installing php 5.6.23 and AFTER)
Apache Version: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.17
Apache API Version: 20120211
PHP Version: 5.5.9-1ubuntu4.17
Configuration File (php.ini) Path: /etc/php5/apache2
Loaded Configuration File: /etc/php5/apache2/php.ini
Scan this dir for additional .ini files: /etc/php5/apache2/conf.d
Noticing that newer versions of PHP are available (such as 5.6.23) but, evidentily not from the default repositories for Linux Mint 17.1, I decided to do the following:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
After restarting the web server (end even rebooting linux), I executed the following:
php -v
PHP 5.6.23-2+deb.sury.org~trusty+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
I verified the following:
5.5.9 is located here: /etc/php
5.6.23 is located here: /etc/php/5.6
Somewhere setting "Configuration File (php.ini) Path" will do the trick, but I do not know where to do this?
Thanks
Mike

Installing xdebug with PHP 5.5

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.

Categories