Mongo PHP driver on dreamhost?
I'm trying to get the mongo php extension to w开发者_如何转开发ork on dreamhost.
I have followed 2 tutorials and still nothing is showing up mongowise.
I have php 5.3 installed, and using a phprc
file I added extension = /home/(myusername)/bin/mongo.so
I've compiled the mongo.so
file from github using these instructions:
http://wiki.dreamhost.com/PHP.ini#Compiling_PHP_5.3_extensions
Then copied the mongo.so
to the /bin/mongo.so
directory.
I'm using phpinfo()
to check installed extensions. It does show that the phprc
is being loaded.
Is there a way of testing the mongo.so
file to make sure it works with php? i.e. some command line php -test mongo.so
or something. Any other tips?
I did get this working. I started from scratch, and wget downloaded the extension from pecl, instead of github. I extracted and then followed the instructions found in the links above.
First, make sure you use php 5.3 to compile and run mongo. Dreamhost is using PHP 5.2 as default, so the domain you want to be running MongoDB needs to be set to PHP 5.3 (probably FastCGI is best choice).
To test and use it on command line you can run:
php-5.3 -r "phpinfo();"
It will show all installed PHP modules and you should see your mongo there.
精彩评论