Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > FAQs > How do I install memcached client for PHP?

How do I install memcached client for PHP?

Table of Contents

 


Answer

For Ubuntu just add the php5-memcache package and reload apache.

For CentOS,  install the package via PECL. This can be done using the Chef recipes included in the PECL Demo ServerTemplate.

Another option is to create a RightScript that will do this at launch time. The RightScript should contain the following:

#!/bin/bash -ex

#
# Test for a reboot,  if this is a reboot just skip this script.
#
if test "$RS_REBOOT" = "true" ; then
  echo "Skip install of PECL::Memcache on reboot."
  logger -t InstallPHPMemcacheScript "Skip Example script on reboot."
  exit 0 # Leave with a smile ...
fi

echo "Installing PECL::Memcache"
echo "y" | pecl install -a -f memcache
if [ $? -eq '0' ]; then
  echo "install completed successfully adding to php.conf"
  echo "extension=memcache.so" > /etc/php.d/memcache.ini
fi

exit 0

Add this RightScript to the boot scripts for your server template and ensure that Apache 2 is restarted after.

You must to post a comment.
Last modified
16:15, 17 Jun 2013

Tags

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.