centos7 安装php扩展mongodb 心得

有时候安装一些东西总是会遇到一些问题,问题不大,记录下来,也算是实践心得吧。

git clone https://github.com/mongodb/mongo-php-driver.git 
cd 目录
phpize
发现出现报错Configuring for:PHP Api Version: 20121113Zend Module Api No: 20121212Zend Extension Api No: 220121212/usr/bin/m4:config.m4:364: cannot open `src/libmongoc/build/autotools/m4/ax_prototype.m4': No such file or directory/usr/bin/m4:config.m4:365: cannot open `src/libmongoc/build/autotools/CheckCompiler.m4': No such file or directory/usr/bin/m4:config.m4:366: cannot open `src/libmongoc/build/autotools/WeakSymbols.m4': No such file or directory/usr/bin/m4:config.m4:367: cannot open `src/libmongoc/build/autotools/m4/ax_pthread.m4': No such file or directory/usr/bin/m4:config.m4:399: cannot open `src/libbson/build/autotools/CheckAtomics.m4': No such file or directory/usr/bin/m4:config.m4:400: cannot open `src/libbson/build/autotools/FindDependencies.m4': No such file or directory/usr/bin/m4:config.m4:401: cannot open `src/libbson/build/autotools/m4/ac_compile_check_sizeof.m4': No such file or directory/usr/bin/m4:config.m4:402: cannot open `src/libbson/build/autotools/m4/ac_create_stdint_h.m4': No such file or directory/usr/bin/m4:config.m4:444: cannot open `src/libmongoc/build/autotools/Versions.m4': No such file or directory/usr/bin/m4:config.m4:458: cannot open `src/libbson/build/autotools/Versions.m4': No such file or directoryautom4te: /usr/bin/m4 failed with exit status: 1


应该是是这样才对。Configuring for:PHP Api Version: 20121113Zend Module Api No: 20121212Zend Extension Api No: 220121212

经过查询,发现缺少东西,安装。


git submodule sync && git submodule update --init
重新安装扩展:
phpize --clean
phpize
./configure with-mongodb-sasl=no
make
make install
如中间报错,简单办法用yum install XX安装缺少插件。

有时候我们总是按照网路步骤一步步走,但并不关注控制台暴漏的信息,虽然是一推英文,但对错还是可以分辨的,建议每步编译完成后,看看控制台编译后的信息,避免浪费时间重复编译。

你可能感兴趣的:(PHP环境配置)