Precompiled REDIS extension for PHP


#1

Hi,

Can you precompile REDIS extension into your PHP builds? We are using PHP7 on Trusty and now have compile PREDIS (instead of native redis extension) ourselves on each build.

This step costs as 20-40 seconds on each build, with a team that has ~100 builds a day it’s becoming very expensive task.

Also I heard same from multiple other people, lot of them are using this and it would save considarable build time for both us and you.


#2

@kimh any chance for this? It would save 30 seconds per each build and we build a lot


#3

In the meantime, you could cache your compiled Predis so that you don’t need to compile it every build.


#4

How can I cache compiled predis/phpredis?

I might be doing it wrong but I tryed this steps:

  1. add phpredis to cache folder
  2. added if that if there is no phpredis folder run this commands
git clone -b php7 https://github.com/phpredis/phpredis.git
cd phpredis
phpize
./configure
make && make install
  1. echo “extension=redis.so” | sudo tee -a /opt/circleci/.phpenv/versions/$(phpenv version-name)/etc/php.ini

But it didnt work. I got error that redis is missing when phpredis folder was cached


#5

Hi @msvrtan,

I have solved it this way:

test -e /opt/circleci/php/7.1.3/lib/php/extensions/no-debug-non-zts-20160303/redis.so || yes '' | pecl install redis

#6