在 centos 下编译安装 php 时,有时候经常会忘了某些扩展,比如 pdo,mysqli,但是到扩展目录下,我们又找不到相应的 扩展文件,(.so 文件) ,这样的情况下只能 编译安装该模块,生成对应的 so 文件,然后在 php.ini 中添加相应的 扩展记录,重启 php
安装mongo拓展:
-
查看所有模块
-
[root@baseservice01 etc]# /usr/local/php/bin/php -m | grep -i mongo ---mongo已安装成功
mongo
-
查看所有信息
-
[root@baseservice01 etc]# /usr/local/php/bin/php -i
-
[root@baseservice01 etc]# /usr/local/php/bin/php -i|grep -i conf
Configure Command => './configure' '--prefix=/usr/local/php' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv-dir' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-magic-quotes' '--enable-safe-mode' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--with-curlwrappers' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-openssl=/usr/local/openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-zip' '--enable-soap' '--without-pear' '--with-gettext' '--enable-fileinfo'
Configuration File (php.ini) Path => /usr/local/php/lib --配置文件路径
Loaded Configuration File => /usr/local/php/lib/php.ini --使用的配置文件
Configuration
Openssl default config => /usr/local/openssl/ssl/openssl.cnf
参考:
http://123haixing.blog.163.com/blog/static/481202052012613111625223/