I am trying to configure MongoDB to work with my Laravel 5.1 Homestead instance on an Ubuntu 14.04 virtual machine. I was able to successfully install the latest version of MongoDB, which supports PHP 7.0 using sudo pecl install mongodb(this is correct for 7.0, not sudo pecl install mongo).
Then I added the extension to my php.ini files (all three) on my Ubuntu computer, each of which:
/etc/php/7.0/cli/php.ini/etc/php/7.0/fpm/php.ini/etc/php/7.0/cgi/php.ini
This is the extension I wrote that is correct for use with PHP 7.0:
extension=mongodb.so (not more than mongo.so)
When I run phpinfo()in my browser, it indicates that MongoDB is configured correctly with my PHP 7.0.
If MongoDB is configured correctly, why do I keep getting:
Fatal error: Class 'MongoDate' not found
php artisan migrate:refresh --seed?
:
- Ubuntu
vagrant reload vagrant reload --provision - PHP Nginx
sudo service nginx restart sudo service php7.0-fpm restart
.