Skip to content

Instantly share code, notes, and snippets.

@locopine
Forked from mingalevme/php-redis-custom-flags.sh
Created January 27, 2023 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save locopine/bdacce738be7fba4eae13c52dea98025 to your computer and use it in GitHub Desktop.
Save locopine/bdacce738be7fba4eae13c52dea98025 to your computer and use it in GitHub Desktop.
Installing PHP Redis extension inside PHP-Alpine-based Docker container
NPROC=$(getconf _NPROCESSORS_ONLN)
mkdir -p /usr/src/php/ext
cd /usr/src/php/ext
pecl bundle redis
docker-php-ext-configure redis --enable-redis-igbinary --enable-redis-lzf
docker-php-ext-install -j${NPROC} redis
cd -
apk --no-cache add pcre-dev ${PHPIZE_DEPS} \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& apk del pcre-dev ${PHPIZE_DEPS} \
&& rm -rf /tmp/pear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment