travis-ci/travis-ci — Issue #315: A way to install PHP extensions
Author: bergie
Created: 2011-11-16 09:04:49+00:00
State: open

Extensions, just like native Node.js modules are a way to bind native libraries into PHP. Currently they are a bit problematic regarding the way Travis CI handles PHP.

I made some attempts to install PHP extensions from debs into Travis:
https://github.com/bergie/midgardmvc_core/blob/master/tests/travis_midgard.sh

Unfortunately this doesn't work, as the PHP used on Travis has been compiled with different parameters than the default Ubuntu PHP packages. So I get:

Warning: PHP Startup: midgard2: Unable to initialize module
Module compiled with build ID=API20090626,NTS
PHP compiled with build ID=API20090626,NTS,debug
These options need to match

In any case using pre-compiled PHP extensions in not a desirable option, as that makes it impossible to support multiple PHP versions in the build.

A better alternative would be to enable projects to build the PHP extensions they need in the `before_script` phase. This would simply need the PHP development environment (`phpize` and `php-config` commands, etc) to be present. On Debian/Ubuntu these would come from the `php5-dev` package, but I'm not sure of the phpfarm setup used on Travis.