25

I tried to install xdebug in my Ubuntu 16.04 with PHP7.0-fmp.

Inside the tailored tool it says:

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.

The FAQ only makes reference to php5-dev in order to install phpize.

Then following How to install and run phpize I found that php7.0-dev also should install phpize.

When I try run sudo apt-get install php7.0-dev I get the message:

php7.0-dev is already the newest version (7.0.8-0ubuntu0.16.04.2).
The following package was automatically installed and is no longer required:
  linux-image-extra-4.4.0-21-generic

That says that all the php7.0-dev package are already installed, but when I run phpize I get the following message:

root@ig:/usr/bin# phpize
Cannot find config.m4. 
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

I am already inside /usr/bin/ . How to run phpize in this scenario?

47
+50

phpize for PHP7 is provided by the package php7.0-dev in Ubuntu 16.04. To install it open the terminal and type:

sudo apt install php7.0-dev  

phpize7.0 will be installed to /usr/bin/phpize7.0

To run it type:

phpize7.0

Example: get version of phpize7.0:

phpize7.0 -v

In Ubuntu 17.10 php7.0-dev has been updated to php7.1-dev and phpize7.1 will be installed to /usr/bin/phpize7.1 . In Ubuntu 18.04 php7.0-dev has been updated to php7.2-dev. In Ubuntu 20.04+ php7.0-dev has been updated to php7.4-dev.

The phpize command is meant to be run at the top level of an extension source directory. This source directory should contain a file named config.m4. The config.m4 file for a PHP extension tells the UNIX build system what configure options your extension supports, what external libraries and includes you require, and what source files are to be compiled as part of it.

| improve this answer | |
  • 1
    worked for php7.4. thanks – Amin Shojaei May 10 at 4:39
13

To have command phpize on Ubuntu 16.04 and PHP7 install this package:

apt-get install php-dev
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.