Create a gist now

Instantly share code, notes, and snippets.

@till /.travis.yml
Last active Nov 8, 2016

What would you like to do?
Since we're upgrading from PHP 5.3 to PHP 5.5 soon, here's an example how to run two builds against PHP 5.3 and PHP 5.5 (with ext/apcu) on Travis-CI! This has been tested on Travis-CI Pro — but should work on Org as well.
language: php
- 5.3
- 5.5
- ./bin/
- phpenv config-add tests/$TRAVIS_PHP_VERSION.ini
- phpenv config-add tests/apc.ini
- composer install
- cd tests/ && phpunit
; this is in `tests/`
; this is in `tests/`
; your general apc settings go here
# this script is in a `bin/` folder
if [ "$TRAVIS_PHP_VERSION" == "5.3" ]
exit 0
# this is helpful to compile extension
sudo apt-get install autoconf
# install this version
# compile manually, because `pecl install apcu-beta` keep asking questions
tar zxvf apcu-$APCU.tgz
cd "apcu-${APCU}"
phpize && ./configure && make install && echo "Installed ext/apcu-${APCU}"

hjr3 commented Jan 10, 2014

You can simplify the install script with

echo "no" | pecl install apcu-beta

hjr3 commented Jan 10, 2014

Using pecl will also add the ini file for you as well!

andig commented Jan 21, 2015

I think it has to be apc.enable_cli=1, not apc.cli_enabled=1

geshan commented Dec 16, 2015

what about PHP 7


$ echo "no" | pecl install apcu-beta
WARNING: channel "" has updated its protocols, use "pecl channel-update" to update
pecl/apcu requires PHP (version >= 7.0.0-dev), installed version is 5.5.21
pecl/apcu requires PEAR Installer (version >= 1.10), installed version is 1.9.5
No valid packages found
install failed
The command "echo "no" | pecl install apcu-beta" failed and exited with 1 during .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment