I'm playing around with Vagrant and Puppet, provisioning a development machine for a project based on Apache/PHP/Mongo.
I have all components setting up correctly (using modules from Puppet Forge), but for the life of me, I can't figure out how to make PHP talk to Mongo. phpinfo()
shows that the Mongo driver is not installed - which only makes sense, as I have no clue how to go about installing it.
The puppet module I use to install PHP is the one from Lab42, available at http://github.com/lermit/puppet-php . The readme demonstrates how to toggle modules but not drivers (afaik, Mongo connectivity is established via a driver rather than a module).
Any help, tips, or links to a .pp
file where this was actually done would be most welcome. Thank you!
Update:
Figured out this magic line: php::pecl::module { "mongo": }
To basically add Mongo support via PECL. But when Puppet tries to run it, I get this:
err: /Stage[main]/Project/Php::Pecl::Module[mongo]/Package[php-mongo]/ensure:
change from purged to present failed:
Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5-mongo'
returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Couldn't find package php5-mongo
So, a couple of things I don't understand about this:
- If I asked Puppet to install the module via PECL, why's it doing it via apt-get?
- Why can't it find that package? What repo should I add to make it work?
Thanks again.