When setting up my development environment on my new Mac (running OSX 10.8) I noticed autoconf was missing. Autoconf is used by phpize to compile php extensions like xdebug and is something I use on a reasonably frequent basis.
The error I got when trying to run php on the xdebug extension was:
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: `phpize’ failed
When running previous versions of OSX autoconf has either been included (<10.6) or available by installing xcode and the development command line tools. However after installing the latest version of xcode (4.3) I found autoconf absent from there as well!
The solution I came up with was to compile autoconf from source and set the environment variable which points to autoconf required by phpize.
curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz
Untar the autoconf archive
tar -xvzf autoconf.tar.gz
Configure and make – note the folder un-archived may have a different name.
sudo make && sudo make install
This installs autoconf to ‘/usr/local/bin/autoconf’. In order to get phpize to work set the PHP_AUTOCONF environment variable to point to the newly installed autoconf.
Running phpize when attempting to compile a php extension should now work.