[root@appstore bin]# ./pecl install mongodb
downloading mongodb-1.1.8.tar ...
Starting to download mongodb-1.1.8.tar (4,428,288 bytes)
..................................................................................................................................................................................................done: 4,428,288 bytes
360 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
configure:7611: error: possibly undefined macro: AS_CASE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure:7616: error: possibly undefined macro: AS_EXECUTABLE_P
configure:7616: error: possibly undefined macro: AS_IF
configure:7617: error: possibly undefined macro: AC_CHECK_PROGS
ERROR: `phpize' failed
downloading mongodb-1.1.8.tar ...
Starting to download mongodb-1.1.8.tar (4,428,288 bytes)
..................................................................................................................................................................................................done: 4,428,288 bytes
360 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
configure:7611: error: possibly undefined macro: AS_CASE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure:7616: error: possibly undefined macro: AS_EXECUTABLE_P
configure:7616: error: possibly undefined macro: AS_IF
configure:7617: error: possibly undefined macro: AC_CHECK_PROGS
ERROR: `phpize' failed
解决方法参照
http://www.oschina.net/question/106965_2175213
按票数排序 显示最新答案 共有5个答案 (最后回答: 2个月前 )
-
你应该是有依赖的库没有安装齐全,不是mongodb的依赖库,而是本身php所需要的系统底层的dev库缺失。
或者你可以试试使用我的这个开源的类库:http://git.oschina.net/janpoem/ubuntu-server-deploy/tree/php7/
使用:
git clone https://git.oschina.net/janpoem/ubuntu-server-deploy.git git checkout php7 cd ubuntu-server-deploy ./php.sh install ./php.sh install-ext mongodb
-
补充一下,如果你希望知道具体的php扩展dev的依赖,可以参考这里的源代码的内容:
公共基础部分需要的库:
build-essential bison openssl libreadline6 libreadline6-dev curl git git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev libc6-dev g++ gcc unzip p7zip-full
php所需的dev库:
apt-get install -y gcc-4.8 g++ automake autoconf libtool apt-get install -y libxml2-dev bzip2 libcurl4-openssl-dev apt-get install -y libcurl4-gnutls-dev apt-get install -y libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libmysql++-dev libxslt1-dev libbz2-dev libghc-regex-pcre-dev libicu-dev
我的服务器环境统一都是ubuntu server,如果你是centos,上述的这些包,其实基本上也有yum对应的库和版本的,基本是相似的。
-
下面的内容,是我之前帮朋友安装centos 6.6服务环境的时候的记录,你也可以参考一下:
公共基础部分需要的库:
yum install -y epel-release.noarch yum install -y kernel-headers.x86_64 kernel.x86_64 kernel-devel.x86_64 gcc.x86_64 gcc automake autoconf libtool make yum install -y zlib-devel.x86_64 openssl-devel.x86_64 pcre-devel.x86_64 libaio-devel.x86_64 automake.noarch yum install -y jemalloc-devel.x86_64 jemalloc.x86_64 libxml2-devel.x86_64 libxslt-devel.x86_64 gd-devel.x86_64 GeoIP-devel.x86_64 GeoIP-devel.x86_64 GeoIP.x86_64 yum install -y gcc-c++.x86_64
php所需的dev库:
yum install -y libtool.x86_64 libtool-ltdl-devel.x86_64 bzip2.x86_64 bzip2-devel.x86_64 libcurl-devel.x86_64 curl.x86_64 libcurl.x86_64 libpng-devel.x86_64 libpng10-devel.x86_64 openjpeg-devel.x86_64 libXpm-devel.x86_64 libmcrypt-devel.x86_64 libmcrypt.x86_64 mcrypt.x86_64 mysql-devel.x86_64 bzip2.x86_64 pcre.x86_64 pcre-devel.x86_64 libicu-devel.x86_64 libicu.x86_64
-
解决办法:http://ruby-china.org/topics/2434
###安装m4
wget http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz \
&& tar -xzvf m4-1.4.13.tar.gz \
&& cd m4-1.4.13 \
&& ./configure --prefix=/usr/local
make && make install
cd ..
###安装autoconf
wget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz \
&& tar -xzvf autoconf-2.65.tar.gz \
&& cd autoconf-2.65 \
&& ./configure --prefix=/usr/local
make && make install
cd ..
###安装automake
wget http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz \
&& tar xzvf automake-1.11.tar.gz \
&& cd automake-1.11 \
&& ./configure --prefix=/usr/local
make && make install
cd ..
###安装libtool
wget http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz \
&& tar xzvf libtool-2.2.6b.tar.gz \
&& cd libtool-2.2.6b \
&& ./configure --prefix=/usr/local
make && make install
cd ..