Skip to content

Instantly share code, notes, and snippets.

@gyndav
Created April 10, 2012 12:57
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save gyndav/2351174 to your computer and use it in GitHub Desktop.
Save gyndav/2351174 to your computer and use it in GitHub Desktop.
Simple Mongo PHP Driver extension installer for Travis CI. Works like a charm for other PECL extensions too.
before_script:
- ./path/to/mongo-php-driver-installer.sh
#!/bin/bash
wget http://pecl.php.net/get/mongo-1.2.10.tgz
tar -xzf mongo-1.2.10.tgz
sh -c "cd mongo-1.2.10 && phpize && ./configure && sudo make install"
echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
@gyndav
Copy link
Author

gyndav commented Apr 10, 2012

Credits goes to @bergie for grep/sed tricks.

@adrienbrault
Copy link

@gustawdaniel
Copy link

Update:

mongo is the old driver which is not compatible with PHP 7, you need to use new driver mongodb.

https://stackoverflow.com/questions/38036060/pecl-mongo-requires-php-version-5-3-0-version-5-99-99-installed-versio

For php 7 there is recommended to use pecl install -f mongodb-stable

https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/.travis.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment