Skip to content

Instantly share code, notes, and snippets.

@paul91
Created May 5, 2014 14:33
Show Gist options
  • Select an option

  • Save paul91/11538376 to your computer and use it in GitHub Desktop.

Select an option

Save paul91/11538376 to your computer and use it in GitHub Desktop.
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
cd libmemcached-1.0.16
# Compile and install liblmemcached with sasl disabled
./configure --disable-memcached-sasl
make
make install
# After memcached's dependencies has been satisfied, install it with pecl
pecl install memcached
# Enable it for PHP
echo "extension=memcached.so" > /etc/php.d/memcached.ini
# Restart any PHP related daemons
service httpd restart
@youad01

youad01 commented Nov 15, 2014

Copy link
Copy Markdown

Hello
thank you for the tuto
when i make all steps and after restart httpd
i execute php -m to know if memcached work i see this error message

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: undefined symbol: memcached_bucket_set in Unknown on line 0

help please

@yekz

yekz commented May 28, 2015

Copy link
Copy Markdown

thank you!

@lpalgarvio

Copy link
Copy Markdown

@Csardelacal

Copy link
Copy Markdown

Because this comes up when you Google looking for how to install the Memcached extension on CentOS. It may be easiest for you to just use the package manager command:

yum install php56w-pecl-memcached.i386

In case you're getting a broken dependency (because you, like me, have a different version of PHP installed than the one that ships with your repository) use --skip-broken to get it to work. Be careful when using this option since it might not be the PHP version in your case, look carefully before skipping broken packages.

@waqleh

waqleh commented Jun 30, 2016

Copy link
Copy Markdown

thank you.

@webysther

Copy link
Copy Markdown

configure: WARNING: unrecognized options: --disable-memcached-sasl

@agastiazoro

agastiazoro commented Dec 13, 2016

Copy link
Copy Markdown

if you have this error running "pecl install memcached"

running: phpize
sh: phpize: command not found
ERROR: `phpize' failed

then you can install:
yum install php-devel

Thanks paul91

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