Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add a blog post on preinstalled PHP extensions.

  • Loading branch information...
commit cf9a94d806cf7c03aa2d0ca33f9f89193d101e8f 1 parent a5c1f90
Loïc Frering loicfrering authored

Showing 1 changed file with 64 additions and 0 deletions. Show diff stats Hide diff stats

  1. +64 0 blog/_posts/2013-03-08-preinstalled-php-extensions.md
64 blog/_posts/2013-03-08-preinstalled-php-extensions.md
Source Rendered
... ... @@ -0,0 +1,64 @@
  1 +---
  2 +title: Preinstalled PHP extensions
  3 +permalink: blog/2013-03-08-preinstalled-php-extensions
  4 +created_at: Wed Mar 06 18:56:00 CET 2013
  5 +author: Loïc Frering
  6 +twitter: loicfrering
  7 +layout: post
  8 +---
  9 +
  10 +When your project depends on some particular PHP extension, installing this
  11 +extension at each build on Travis takes some time and slows down your CI
  12 +feedback loop. In order to improve this situation and to get your builds
  13 +running as fast as possible, I'm glad to announce that there are now some
  14 +common PHP extensions directly preinstalled on Travis!
  15 +
  16 +No need to manually build them anymore, here is a list of the preinstalled
  17 +extensions available right now:
  18 +
  19 +* [apc.so](http://php.net/apc)
  20 +* [memcache.so](http://php.net/memcache)
  21 +* [memcached.so](http://php.net/memcached)
  22 +* [mongo.so](http://php.net/mongo)
  23 +* [amqp.so](http://php.net/amqp)
  24 +* [zmq.so](http://php.zero.mq/)
  25 +
  26 +Watch out, these extensions are *not enabled by default*, so you'll have to
  27 +explicitly enable them by adding an `extension="<extension>.so"` line to your
  28 +PHP configuration.
  29 +
  30 +But it was not particularly easy to customize Travis' PHP configuration until
  31 +now because you had to know where was located the php.ini file of the current
  32 +PHP version you were running your tests against. So I developed a little
  33 +extension to [phpenv](https://github.com/CHH/phpenv) that allows to easily add
  34 +a config file with all the configuration directives that make sense for your
  35 +build with a simple command! Just use `phpenv config-add` and `phpenv
  36 +config-rm` to add or remove a configuration file. You can refer to the
  37 +documentation for more details on how to [customize PHP
  38 +configuration](http://about.travis-ci.org/docs/user/languages/php/#Custom-PHP-configuration).
  39 +
  40 +Thereby, the easiest way to enable a preinstalled extension is by using `phpenv
  41 +config-add` to add a custom config file that enables and configures if necessary
  42 +the extension you need:
  43 +
  44 + before_script: phpenv config-add myconfig.ini
  45 +
  46 +And myconfig.ini:
  47 +
  48 + extension = "mongo.so"
  49 + # some other mongo specific configuration directives
  50 + # or general custom PHP settings...
  51 +
  52 +For more information, please refer to the [PHP extensions
  53 +section](http://about.travis-ci.org/docs/user/languages/php/#PHP-extensions) of
  54 +the documentation!
  55 +
  56 +We encourage you to update your Travis setup to take advantage of this new
  57 +feature. Also if you experience any issue or if you feel that there is a really
  58 +important extension that should be preinstalled on Travis, feel free to open an
  59 +[issue on GitHub](https://github.com/travis-ci/travis-ci/issues).
  60 +
  61 +I hope that you will enjoy this new feature and that it will make your test
  62 +settings easier and speed up your builds!
  63 +
  64 +Happy testing!

0 comments on commit cf9a94d

Please sign in to comment.
Something went wrong with that request. Please try again.