简体   繁体   中英

MongoDB PHP Driver not loaded in fpm - but loaded in cli

The system and tools installed on are the following ones:

  • Linux server Ubuntu 16.04.1 LTS
  • php7.0
  • mongoDB version v3.2.12
  • mongoDB php driver 1.2.5 .

And I have carefully added extension=mongodb.so in both /etc/php/7.0/fpm/php.ini and /etc/php/7.0/cli/php.ini .

Then I have a document info.php which contains <?php phpinfo(); ?> <?php phpinfo(); ?>

So php -f info.php return that mongoDB is correctly loaded, and I can instantiate the various classes and play with them.

But if load the file into a web browser www.myserver.com/info.php , I cannot find the mongoDB section. And indeed all mongoDB-PHP-driver code fails.

Is it because MongoDB-php-driver is not correctly installed for the php/fpm ? Or is it because MongoDB itself is not correctly installed ?

Thanks a lot

sudo systemctl restart php7.0-fpm.service重启。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM