phpize configure error: cannot find sources (config.m4)

Updated on May 14, 2020

Question: Trying to install one of the PHP extension from the source. I ran phpize command and encountered the error “phpize configure error: cannot find sources (config.m4)“.

Below is the complete error message:

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

Solution: The phpize, command is meant to be run at the top-level source directory of the module/extension. For example, I was trying to install mysqlnd. So you need to be in php7.2.3/ext/mysqlnd. If you are running inside the source directory of the extension and still getting the error, then the directory should contain a file named config.m4.

Firstly list down the files with config*

#ls config*
config.w32  config9.m4

Simply, copy the file config9.m4 to config.m4

#cp config9.m4 config.m4

Now run phpize for successful compilation

#phpize
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718

Was this article helpful?

Related Articles

Leave a Comment