Installing the PHP 7 MongoDB Client/Driver?

后端 未结 12 939
日久生厌
日久生厌 2020-11-28 06:17

I am very eager to start working with PHP 7 however one issue is getting in the way... I primarily use MongoDB for the database, and the problem is that I don\'t know how to

12条回答
  •  执念已碎
    2020-11-28 06:54

    Complementing answers and publishing what worked for me:

    1 followed this guide in order to install lamp https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04 (The third step is needed only for installing the mongo client)

    2 $ sudo apt-get install php7.0-dev

    3 $ sudo pecl install mongodb

    4 $ sudo nano /etc/php/7.0/apache2/php.ini

    Add the following line in the file:

    extension = mongo.so;

    (You might need to specify the exact location of the file. In my case the file was in /usr/lib/php/20151012/mongodb.so.)

    And thats all for installing just the mongo client for php 7.0

    I am complementing the Pransh Tiwari answer

提交回复
热议问题