PHP MongoDB的驱动程序不工作在CentOS [英] PHP MongoDB Driver not working on centos

查看:427
本文介绍了PHP MongoDB的驱动程序不工作在CentOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装PHP的蒙戈司机CentOS的服务器(CentOS的释放,7-2.1511点¯x86_64)。这是CentOS的手册,我简称:的说明书1 手册2

一切工作在本地主机上罚款,但是当我尝试在它不工作的CentOS运行它,并产生多个错误。

在使用的phpinfo()本地主机上,它显示Mongo的细节,但它不工作在CentOS。

下面是PHP我试图运行:

  $康恩=新MongoClient();
$数据库= $ conn-> MYDB;
$收集= $数据库 - > createCollection('MyCollection的');


解决方案

我重新启动Apache服务,每当我使用改变php.ini文件的东西,所以我刚刚重新启动的php-fpm的CentOS上的每个时间服务PHP-FPM重启及其工作正常了!

当你使用WAMP为当地的发展,可以从托盘菜单,但生产服务器,这些服务需要单独重新启动重新启动所有服务,它发生。

I'm trying to setup the Mongo driver for PHP on CentOS server(centos-release-7-2.1511 x 86_64). These are the CentOS manuals I've referred to: manual 1 and manual 2

Everything works fine on localhost but when I try to run it on CentOS it's not working and produces multiple errors.

While using phpinfo() on localhost, it shows details for Mongo but it's not working on CentOS.

Here is the PHP I'm trying to run:

$conn = new MongoClient();  
$database = $conn->mydb;
$collection = $database->createCollection('mycollection');  

解决方案

I was restarting Apache service each-time whenever i was changing something in php.ini file so i have just restarted php-fpm on centos using service php-fpm restart and its working fine now !

It happens when you use wamp for local development which can restart all services from tray menu but on production server these service need to restart individually.

这篇关于PHP MongoDB的驱动程序不工作在CentOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆