By bertanyaseo
2014/06/28 16:39:23 [error] 9162#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'Mongo' not found in /usr/share/nginx/html/req.php on line 4" whil$
and this code on req.php
<?php
session_start();
//mongo connection
$connection = new Mongo();
//database name create if not exist
$keydb = $connection->selectDB('keydb');
$valdb = $connection->selectDB('valdb');
//collection name create if not exist
$keywords = $connection->keydb->kunci;
$konten = $connection->valdb->konten;
?>
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
What version of the MongoDB php library are you using? The Mongo class was deprecated in version 1.3.0. You should now use the MongoClient class.
sudo vi /etc/php.d/mongodb.ini The contents should look something like:
extension=mongo.so
mongo.auto_reconnect = true
mongo.allow_persistent = On
mongo.max_persistent = -1
mongo.max_connections = -1
;mongo.default_host = www.example.com
mongo.default_port = 42
mongo.chunk_size = 1024
mongo.cmd = "$"
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.