Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Last active May 23, 2018 07:48
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 wtnabe/36d830d4d6c168d1ffb86bb5356c3365 to your computer and use it in GitHub Desktop.
Save wtnabe/36d830d4d6c168d1ffb86bb5356c3365 to your computer and use it in GitHub Desktop.
#! /bin/sh
xcode-select --install
brew install php@5.6 postgresql@9.4 brew-php-switcher libmemcached
brew link --force php@5.6
brew link --force postgresql@9.4
#
# install pecl libmemcached
#
git clone -b 2.2.0 https://github.com/php-memcached-dev/php-memcached
cd php-memcached
phpize
./configure --with-libmemcached-dir=$(brew --prefix libmemcached)
make
make install
cd ..
rm -fr php-memcached
#
# enable libmemcached
#
INI_DIR=`php --ini | awk '/Scan for additional.[^\/]+(\/.*)/ {match($0, /\/.*/); print substr($0, RSTART, RLENGTH)}'`
LIB_DIR=`php -r 'ini_set("error_reporting", "0"); phpinfo();' | awk '/^extension_dir/ {print $NF}'`
cat <<EOD > $INI_DIR/ext-memcached.ini
[memcached]
extension=$LIB_DIR/memcached.so
EOD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment