Skip to content

Instantly share code, notes, and snippets.

Created January 13, 2016 09:10
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
AWS Elastic Beanstalk .ebextensions config to install Elasticache memcached cluster client (PHP 5.6)
mode: "000744"
owner: root
group: root
content: |
#hide old ini
if [ -a /etc/php.d/50-memcached.ini ]
mv /etc/php.d/50-memcached.ini /etc/php.d/50-memcached.ini.disabled
#fetch client
wget -O /tmp/AmazonElastiCacheClusterClient-latest-PHP56-64bit.tgz
#uninstall old version (can fail - is ok)
pecl uninstall __uri/AmazonElastiCacheClusterClient
#install new
pecl install /tmp/AmazonElastiCacheClusterClient-latest-PHP56-64bit.tgz
#move module to correct place
mv /root/pear/ext/ /usr/lib64/php/5.6/modules/
chmod +x /usr/lib64/php/5.6/modules/
#remove where client is stuck in wrong place in ini file
sed -i '/extension=""/d' /etc/php.ini
#make correct ini (done as separate file in .ebextensions)
#echo "" | tee /etc/php.d/memcached.ini
mode: "000644"
owner: root
group: root
content: |
;standard settings from 50-memcached
memcached.sess_locking = On
memcached.sess_lock_wait = 150000
memcached.sess_lock_max_wait = 0;
memcached.sess_lock_expire = 0;
memcached.sess_prefix = "memc.sess.key."
memcached.sess_consistent_hash = Off
memcached.sess_remove_failed = 1
memcached.sess_number_of_replicas = 0
memcached.sess_binary = Off
memcached.sess_randomize_replica_read = Off
memcached.sess_connect_timeout = 1000
memcached.sess_sasl_username = NULL
memcached.sess_sasl_password = NULL
memcached.compression_type = "fastlz"
memcached.compression_factor = "1.3"
memcached.compression_threshold = 2000
memcached.serializer = "igbinary"
memcached.use_sasl = Off
memcached.store_retry_count = 2
command: /home/ec2-user/
Copy link

And for PHP 7 version how to proceed?

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