Okay, I have installed everything according to the official MongoDB guidelines. It doesnt work. When I try to set
$connect = new Mongo();
in a php file, it returns me:
Fatal error: Class 'Mongo' not found in /opt/lampp/htdocs/choqlet/contact/index.php on line 3
The mongodb server and the apache are both on... I tried this solution here (by Neil:
Also watched over (and applied) this thread:
Mongodb connection in PHP not working
When i turn phpinfo(); there is no mongo in there.... And when i try php's
echo extension_loaded("mongo") ? "loaded\n" : "not loaded\n"; ?>
It returns me: not loaded.
I have been looking for a solution all day long and nothing seems to work....
Here is the output of php --ini :
Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File: /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed: /etc/php5/cli/conf.d/05-opcache.ini,
/etc/php5/cli/conf.d/10-pdo.ini,
/etc/php5/cli/conf.d/20-json.ini,
/etc/php5/cli/conf.d/20-readline.ini,
/etc/php5/cli/conf.d/30-mongo.ini
And php -m:
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mhash
mongo
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
So, mongo SHOULD work... I also ran
php -i | grep extension_dir
And it gave me some weird output:
PHP Warning: Module 'mongo' already loaded in Unknown on line 0
extension_dir => /usr/lib/php5/20121212 => /usr/lib/php5/20121212