This post is about FreeBSD, however the idea is about the same for other Unix systems.
While I tried to install memcached, the system complained with this message:
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
This problem is caused by missing couple variables at the shell level: PHP_AUTOCONF, PHP_AUTOHEADER. It is very easy to solve this problem:
1. First, make sure that Autoconf is installed in your system:
#pkg_info | grep autoconf autoconf-2.68 Automatically configure source code on many Un*x platforms autoconf-wrapper-20071109 Wrapper script for GNU autoconf
If autoconf is not available, install it from here:
cd /usr/ports/devel/autoconf268 make install clean
2. Now, we need to set couple variables. This step is very important because you can’t set the variable using sudo export x=y. First, switch to root
3. Find out where is autoconf (The location in FreeBSD and Linux are different)
4. Set the autoconf, in my case, it is /usr/local/bin/autoconf
5. Do the same thing for autoheader:
which autoheader export PHP_AUTOHEADER=/usr/local/bin/autoheader
That’s it. Now try to install your software again and the error message should be gone.