Solution of Cannot find autoconf in PHP Dynamic Compilation

  • 2021-07-24 10:37:19
  • OfStack

This paper describes the solution of Cannot find autoconf in PHP dynamic compilation. Share it for your reference. The specific methods are as follows:

After installing PHP, you want to dynamically compile the memcache extension library of PHP

cd memcache-2.2.5/
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config

However, an error occurred while executing/usr/local/webserver/php/bin/phpize:

Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
Cannot find autoconf. Please check your autoconf installation and the  $PHP_AUTOCONF  environment variable is set correctly and then rerun this script.


Searching for 1 pass on the Internet, I found that there are quite a few people asking this question, and I picked up 1 paragraph:
# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# tar -zvxf m4-1.4.9.tar.gz
# cd m4-1.4.9/
# ./configure && make && make install
# cd ../
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install

If it is UBUNTU, it can be simpler:
sudo apt-get install m4
sudo apt-get install autoconf

Or directly:
sudo apt-get install autoconf

Because autoconf depends on m4, it will be downloaded automatically to resolve this dependency.

I hope this article is helpful to everyone's PHP programming.


Related articles: