This refers to the MongoDB driver of PHP.
Version:
> Cat/etc/os-release
Name= "CentOS Linux"
version= "7 (Core)"
Id= "CentOS"
Id_like= "Rhel Fedora"
Version_id= "7"
Pretty_name= "CentOS Linux 7 (Core)"
Ansi_color= "0;31"
Cpe_name= "Cpe:/o:centos:centos:7"
Home_url= "https://www.centos.org/"
Bug_report_url= "https://bugs.centos.org/"
centos_mantisbt_project= "CentOS-7"
centos_mantisbt_project_version= "7"
redhat_support_product= "CentOS"
redhat_support_product_version= "7"
> php-v
PHP 7.1.14 (CLI) (Built:feb-2018 13:55:05) (NTS)
Copyright (c) 1997-2018 the PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
> nginx-v
Nginx version:nginx/1.12.2
> Mongod--version
DB version v3.6.3
Git version:9586e557d54ef70f9ca4b43c26892cd55257e1a5
OpenSSL Version:openssl 1.0.1e-fips 2013
Allocator:tcmalloc
Modules:none
Build Environment:
Distmod:rhel70
Distarch:x86_64
Target_arch:x86_64
Installation/configuration process:
--Install PHP-FPM (ref:https://github.com/terrylinooo/daily/wiki/install-nginx,-php-7,-mariadb-10-(LEMP)- ON-CENTOS-7)
Yum Install PHP71W-FPM
After the installation is complete, configure the/etc/php-fpm.d/www.config:
listen = /var/run/php-fpm/php-fpm.sock
listen.owner = nobody
listen.group = nobody
user = nginx
group = nginx
There may be an error when you start Nginx, execute:chown nginx:nginx /var/run/php-fpm/php-fpm.sock
--Install MongoDB driver for PHP (ref:http://blog.csdn.net/username11211/article/details/52945488)
> wget https://pecl.php.net/get/mongodb-1.4.1.tgz
> Tar-xvzf mongodb-1.4.1.tgz
> CD mongodb-1.4.1
> phpize
>./configure--with-php-config=/usr/bin/php-config
> Make && make Install
--Configure PHP.ini
cgi.fix_pathinfo=0
add extension=mongodb.so in the php.ini file
--Configure Nginx.config
The server segment is added:
location ~ \.php$ {
try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
--Start PHP-FPM
Systemctl Start PHP-FPM
Systemctl Enable PHP-FPM
--Restart Nginx
Systemctl Restart Nginx
Configuring Nginx's MongoDB drive problem under CENTOS7