Table of contents

Cannot find autoconf when running the phpize command

PHP Jul 01, 2020 Viewed 509 Comments 0

Issue

In order to debug php-7.4.7 with phpstorm. I download the xdebug source, and run the following command to configure xdebug.

$ wget http://xdebug.org/files/xdebug-2.9.6.tgz
$ tar xf xdebug-2.9.6.tgz
$ cd xdebug-2.9.6
$ /opt/php-7.4.6/bin/phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

Solution

1. Install autoconf

  • Mac OS
brew install autoconf
  • Ubuntu/Debian

In the webpage https://pkgs.org/search/?q=autoconf, download autoconf or run with apt-get.

sudo apt-get install autoconf
  • RHEL/CentOS

In the webpage https://pkgs.org/search/?q=autoconf, download autoconf or run with yum.

sudo yum install autoconf

2. Install xdebug

After installing autoconf, continue to run the configure xdebug command.

$ /opt/php-7.4.6/bin/phpize
$ ./configure --prefix=/opt/php-7.4.6 --with-php-config=/opt/php-7.4.6/bin/php-config
$ make
$ sudo make install

Finally, add the following line in the php.ini file.

extension=xdebug.so
Updated Jul 01, 2020