Install PHP driver for MongoDB on MAMP

I want to install the PHP driver on MAMP 1.9.6 (OS X 10.5.8) and PHP 5.3

I did everything I said at http://www.mongodb.org/display/DOCS/PHP+Language+Center But it still won’t work.

If I try to connect, it throws the error "Fatal Error: Class" Mongo 'not found "But the Mongo class was found in PHPStorm and autocomplete works. I added the extension in php.ini

To install Mongo in the terminal, I wrote

sudo /Applications/MAMP/bin/php5.3/bin/pecl install mongo 

And everything was installed correctly.

What am I doing wrong?

+4
source share
3 answers

Follow this guide:

http://www.davidgolding.net/mongodb/installing-mongodb-on-mamp-1-9-5.html

The key part is capturing the driver binary code here: https://github.com/mongodb/mongo-php-driver/downloads

Copy the binary to the folder specified in the manual, then make changes to the php.ini file.

0
source

I believe that you need to do the following:

 sudo port install mongodb 

I followed this link during installation and did not experience any problems: Apache, PHP and MongoDB on Mac OS X

+1
source
  • using the package manager of your choice (e.g. homebrew, port, apt-get, etc.) install mongo
  • configure your MAMP environment to install additional extensions after this tutorial: http://blog.jellystyle.com/post/37099202581/installing-php-extensions-with-mamp
  • Once your mom is ready, run sudo pecl install mongo
  • restart mom service
  • you can run phpinfo () in a browser and find Mongo there (and this should be the latest version).
+1
source

Source: https://habr.com/ru/post/1381775/


All Articles