mongo.so not working with PHP on my server

Hi there,

I have MongoDB installed on my server. It works, but I am having a very tough time with inclusion of the mongo.so extension for PHP.

- I've upgraded my php to the latest version (but it also didn't work on the 5.2.x)
- I've used the pecl mongo install and uninstall command many times
- I've made sure that the mongo.so is in the correct inclusion directory for PHP extensions
- i've added the extension=mongo.so to my correct php.ini file.
- I've also tried the manual complie of the driver

When i try phpinfo(); the mongo extension is simply not there. But it is interesting that i see the mongo module if i run php -m on the server. weird right!

Im on CentOS, using Apache 2.2 with php 5.3.8

Thank you
xNejXAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jayachandran PalanisamyTechnical Consultant - LinuxCommented:
Hi,
Please let me know the following outputs.

php -i |grep php.ini
php -m |grep mongo

Which line you have added into your php.ini file?

-Jay
0
xNejXAuthor Commented:
Hi,

this is the output. I am using the correct php.ini file. I've added the extension=mongo.so, which is located in the correct folder for extensions.

[root@server lib]# php -i |grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Open in new window


[root@streznik87 lib]# php -m |grep mongo
mongo

Open in new window


Thank you for your help.


0
xNejXAuthor Commented:
Well, after compiling the extension about 80 times I've decided to check if the extension path can be relative as it currently was set in the php.ini:

extension_dir = "./"

Open in new window


it turns out that php doesn't quite understand relative paths in its configuration files, so by simply changing the extension dir to the absolute location solved my problem:

extension_dir = "/usr/local/lib/"

Open in new window


even though the php.ini file was located in the /usr/local/lib/ directory i guess it still needs the path to be relative. This extension_dir = "./" is a generic config in the directadmin control panel so do be careful.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xNejXAuthor Commented:
I figured it out by myself
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.