Thursday, November 28, 2019

MongoDB in PHP





The MongoDB PHP driver should work on nearly any system: Windows, Mac OS X, Unix, and Linux; little- and big-endian machines; 32- and 64-bit machines; PHP 5.2, 5.3, 5.4 and 5.5.

Install MongoDB Driver PHP

  • sudo pecl install mongo
  • Add extension=mongo.so in php.ini (/etc/php5/cli/php.ini)
  • Restart Apache: sudo service apache2 restart
Check Installed MongoDB
  • Check is MongoDB extensions already loaded in your PHP php --ini
    already installed: /etc/php5/cli/conf.d/mongo.ini
  • Check is MongoDB extesions already enabled php -i | grep 'Mongo' Already Enabled: MongoDB Support => enabled
  • Type <? phpinfo(); in your PHP applications.
Share:

0 comments:

Post a Comment