xdebug for php 7 on ubuntu 14.04
Asked Answered
I

1

7

I'm trying to get xdebug working on PHP 7. I'm build the xdebug.so file from version http://xdebug.org/files/xdebug-2.4.0rc4.tgz. The phpize output looks correct (Zend Extension Api No: 320151012) however I get Xdebug requires Zend Engine API version 220121212. from PHP.

So I've followed these instructions:

Tailored Installation Instructions

Summary

Xdebug installed: no Server API: Apache 2.0 Handler Windows: no Zend Server: no PHP Version: 7.0.9-1 Zend API nr: 320151012 PHP API nr: 20151012 Debug Build: no Thread Safe Build: no Configuration File Path: /etc/php/7.0/apache2 Configuration File: /etc/php/7.0/apache2/php.ini Extensions directory: /usr/lib/php/20151012 Instructions

Download xdebug-2.4.1.tgz Unpack the downloaded file with tar -xvzf xdebug-2.4.1.tgz Run: cd xdebug-2.4.1 Run: phpize (See the FAQ if you don't have phpize.

As part of its output it should show:

Configuring for: ... Zend Module Api No: 20151012 Zend Extension Api No: 320151012 If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

Run: ./configure Run: make Run: cp modules/xdebug.so /usr/lib/php/20151012 Edit /etc/php/7.0/apache2/php.ini and add the line zend_extension = /usr/lib/php/20151012/xdebug.so Restart the webserver

With the exception that I've installed php7.0-dev instead of php5 apt-get install -y php7.0-dev.

When I run the phpize command I get the following output:

Configuring for:

PHP Api Version: 20151012

Zend Module Api No: 20151012

Zend Extension Api No: 320151012

As expected. However when I run PHP I get:

Xdebug requires Zend Engine API version 220121212.

The Zend Engine API version 320151012 which is installed, is newer.

Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.

I'm obviously doing something wrong somewhere! Any help on debugging the issue is very appreciated! :)

Impetigo answered 19/8, 2016 at 13:35 Comment(0)
I
7

So I fixed this by using the apt-get package: apt-get install -y php-xdebug

This seems to install the correct xdebug.so file and everything is working!

Impetigo answered 22/8, 2016 at 12:8 Comment(2)
I had Xdebug requires Zend Engine API version 320151012. The Zend Engine API version 320170718 which is installed, is newer. error and your solution worked for me. (only had missing xdebug.so error so I just copied file where it was missing, in my case /usr/lib/php/20151012)Thomas
This worked for me twoo with the Xdebug requires Zend Engine API version XXXXXXXXX error. I had to remove xdebug.so attemps from the php.ini so the apt-get can add it durint installationDelossantos

© 2022 - 2024 — McMap. All rights reserved.