Skip to content

Instantly share code, notes, and snippets.

@strategio
Last active May 19, 2024 15:54
Show Gist options
  • 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}
@strategio
Copy link
Author

Hi @michael-sumner!
Sorry but this snippet is 5 years old and I didn't even remember it existed...
And now I don't use Local anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment