Skip to content

Instantly share code, notes, and snippets.

@strategio
Last active February 21, 2024 22:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save strategio/797087099cea854f1b614a8f81be2935 to your computer and use it in GitHub Desktop.
Save strategio/797087099cea854f1b614a8f81be2935 to your computer and use it in GitHub Desktop.
Setup memcached in a Local by Flywheel site
#!/usr/bin/env bash
PHP_VERSION=$1
CONF_FOLDER="/conf/php/${PHP_VERSION}/"
PHP_INI="${CONF_FOLDER}php.ini"
apt-get -y update
apt-get -y install memcached
service memcached start
# Now for installing php 7 memcached extension
apt-get -y install build-essential pkg-config git autoconf
apt-get -y install libmemcached-dev libmsgpack-dev libmsgpackc2
cd ${CONF_FOLDER}
git clone --depth 1 https://github.com/php-memcached-dev/php-memcached.git
cd php-memcached
/opt/php/${PHP_VERSION}/bin/phpize
./configure --with-php-config=/opt/php/${PHP_VERSION}/bin/php-config
make install
make test
# Include memcached in php.ini
echo "[memcached]" >> ${PHP_INI}
echo "extension = ${CONF_FOLDER}/php-memcached/modules/memcached.so" >> ${PHP_INI}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment