MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001273XdebugInstallationpublic2016-02-18 21:412018-02-01 11:39
Reporterdgoosens 
Assigned Toderick 
PrioritynormalSeverityblockReproducibilityhave not tried
StatusresolvedResolutionno change required 
PlatformUbuntu 14.04 64bitOSOS Version
Product Version2.4.0rc4 
Target VersionFixed in Version 
Summary0001273: impossible to build correct xdebug for PHP5.6 if PHP7.0 also installed
DescriptionWhen PHP5.6 & PHP7.0 are installed, it appears the wrong PHP includes path is used during ./configure

This results in a xdebug.so extension that can not be loaded by PHP 5.6

Failed loading /usr/lib/php/20131226/xdebug.so: /usr/lib/php/20131226/xdebug.so: undefined symbol: zend_sort
Steps To ReproduceFollowed these instructions to install PHP5.6 & PHP7.0:
http://www.lornajane.net/posts/2016/php-7-0-and-5-6-on-ubuntu [^]

For PHP7.0 --> WORKING
tar -xvzf xdebug-2.4.0rc4.tgz
cd xdebug-2.4.0RC4
phpize7.0
./configure
make
cp modules/xdebug.so /usr/lib/php/20151012
then create xdebug.ini etc.

For PHP7.0 --> WORKING
tar -xvzf xdebug-2.4.0rc4.tgz
cd xdebug-2.4.0RC4
phpize5.6
./configure
make
cp modules/xdebug.so /usr/lib/php/20131226
then create xdebug.ini etc.
Additional InformationGot it working though...

Noticed that during ./configure (for PHP5.6 version)
console spit out info indicating that it was using /usr/includes/php/20151012 as PHP includes path
this path is for PHP7.0

did
sudo mv /usr/includes/php/20151012 /usr/includes/php/20151012.BU
sudo cp /usr/includes/php/20131226 /usr/includes/php/20151012

and followed the standard procedure and then it worked

remember to reset include paths back afterwards
sudo rm -R /usr/includes/php/20151012
sudo mv /usr/includes/php/20151012.BU /usr/includes/php/20151012
Tagsmake clean
Operating System
PHP Version5.6.0-5.6.4
Attached Files

- Relationships

-  Notes
(0003518)
derick (administrator)
2016-02-23 22:49

I'm not sure what the problem is. As long as you have everything nicely split out and use a path, you can install it with as many versions as you want. I run 13 on my laptop and 14 on my desktop. I wrote about it before too: https://derickrethans.nl/multiple-php-version-setup.html [^]
(0003577)
derick (administrator)
2016-04-04 11:01

You need to make sure that in between compiles for different PHP versions you need to run "make clean". You can also use the "./rebuild.sh" script to do this for you.
(0004211)
netbrothers-tr (reporter)
2017-02-09 11:04
edited on: 2017-02-09 11:05

Hi derick, I'm new to compiling xdebug myself. I've experienced above issue but can't seem to make it work by simply using "make clean". Even if I extract the tarball freshly I run into this. I have installed PHP 7 by the package manager (on Debian) and PHP 5.6 (and others) in my opt directory. So system wide paths are adjusted for PHP 7. I use the phpize of PHP 5.6 to build xdebug.

Is there any option I can pass to the configure command to not use the PHP 7 include dir but the PHP 5.6 one? Respectively, which global variables do I have to adjust to make it work? Thank you for any directions.

(0004212)
dgoosens (reporter)
2017-02-09 11:12

hi netbrothers-tr

Only way I got it to work with two PHP installs is by using the hack I put in the additional information:

---------------------------------------------------------------
# hack
sudo mv /usr/include/php/20151012 /usr/include/php/20151012.BU
sudo cp -r /usr/include/php/20131226 /usr/include/php/20151012

# standard procedure
phpize5.6
./configure
make

# reset hack
sudo rm -R /usr/include/php/20151012
sudo mv /usr/include/php/20151012.BU /usr/include/php/20151012
---------------------------------------------------------------
(0004213)
netbrothers-tr (reporter)
2017-02-09 12:51

Thanks, dgoosens!
(0004216)
serikd (reporter)
2017-02-11 22:13
edited on: 2017-02-11 22:15

Yet another simple way.
Just set version of php.

Steps:
- download xdebug
- tar -xvzf xdebug.tar
- cd xdebug
- phpize7.0
- ./configure --with-php-config=/usr/bin/php-config7.0
- make
- copy xdebug.so to /usr/lib/php/20151012/
- config your php.ini
- enjoy

(0004589)
Firsh (reporter)
2018-02-01 11:09
edited on: 2018-02-01 11:39

I don't think it's a bug. It's expected as both PHP versions are trying to use the same copy of xdebug. What I did was to look for xdebug.so files on the system:

$ sudo find / -iname 'xdebug.so' -print
/usr/lib/php/20160303/xdebug.so
/usr/lib/php/20170718/xdebug.so
/usr/lib/php/20131226/xdebug.so
/usr/lib/php/20151012/xdebug.so
/usr/lib/php5/20121212/xdebug.so

Older versions already existed for me (I'm on AWS Cloud9). The 2017 one was put there by me (I used the excellent https://xdebug.org/wizard.php [^] ). That's for PHP 7.2 but for PHP 5.6 I chose an older one that worked, from 2013. 2015 and 2016 didn't work. 2012 is likely for Cloud9's 5.5.9.

The way I separated which PHP loads which, is by NOT putting this into php.ini (Cloud9 uses a global php.ini, no matter the version, so I keep version-specific config out of that file):

zend_extension = /usr/lib/php/20170718/xdebug.so

or

zend_extension = xdebug.so

So NO loading xdebug from a php.ini that could be reached/loaded/used by any version.

DO put the lines for the appropriate version into these files

/etc/php/7.2/apache2/conf.d/20-xdebug.ini

and

/etc/php/5.6/apache2/conf.d/20-xdebug.ini

Now when I check with phpinfo() I can see 2 distinct versions getting loaded for each. Xdebug v2.5.5 for PHP 5.6 and Xdebug v2.6.0 for PHP 7.2 - I don't need to copy or move them around this way. According to the changelog https://xdebug.org/updates.php [^] Xdebug v2.5.5 is the last version supporting PHP 5.6, so I have the latest version for every system now.


- Issue History
Date Modified Username Field Change
2016-02-18 21:41 dgoosens New Issue
2016-02-23 22:49 derick Note Added: 0003518
2016-02-23 22:49 derick Assigned To => derick
2016-02-23 22:49 derick Status new => feedback
2016-02-27 16:00 derick Status feedback => resolved
2016-02-27 16:00 derick Resolution open => no change required
2016-04-04 00:57 mkungla Tag Attached: make clean
2016-04-04 11:01 derick Note Added: 0003577
2017-02-09 11:04 netbrothers-tr Note Added: 0004211
2017-02-09 11:05 netbrothers-tr Note Edited: 0004211 View Revisions
2017-02-09 11:12 dgoosens Note Added: 0004212
2017-02-09 12:51 netbrothers-tr Note Added: 0004213
2017-02-11 22:13 serikd Note Added: 0004216
2017-02-11 22:15 serikd Note Edited: 0004216 View Revisions
2018-02-01 11:09 Firsh Note Added: 0004589
2018-02-01 11:12 Firsh Note Edited: 0004589 View Revisions
2018-02-01 11:14 Firsh Note Edited: 0004589 View Revisions
2018-02-01 11:39 Firsh Note Edited: 0004589 View Revisions


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker