解决MAC下缺少必要的m4和autoconf包文件问题

今天在mac上编译yaf扩展的时候,遇到这个报错:

:$ /usr/bin/phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

原因是因为缺少m4和autoconf包,解决办法:

下载这两个包:

http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz

http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz

接下来就是编译安装

# tar -zvxf m4-1.4.9.tar.gz

# cd m4-1.4.9/

# ./configure && make && make install

# cd ../

# tar -zvxf autoconf-2.62.tar.gz

# cd autoconf-2.62/

# ./configure && make && make install

然后在执行phpize,成功。

原文地址:https://www.cnblogs.com/smallstong/p/3269011.html