Installing PHP Pecl "memcached" error: memcached support requires libmemcached.

dolomats

Active Member
Dec 14, 2014
31
0
6
cPanel Access Level
Website Owner
Hello

i was able instal memcach from WHM » Software » Module Installers but wasent that successfull with memcached
i get this error :

downloading memcached-2.2.0.tgz ...
Starting to download memcached-2.2.0.tgz (70,449 bytes)
............done: 70,449 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
libmemcached directory [no] : building in /root/tmp/pear/pear-build-root3WL8LD/memcached-2.2.0
running: /root/tmp/pear/memcached/configure --with-libmemcached-dir=no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable memcached support... yes, shared
checking for libmemcached... yes, shared
checking whether to enable memcached session handler support... yes
checking whether to enable memcached igbinary serializer support... no
checking whether to enable memcached json serializer support... no
checking whether to enable memcached msgpack serializer support... no
checking whether to enable memcached sasl support... yes
checking whether to enable memcached protocol support... no
checking for ZLIB... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking for zlib location... /usr
checking for session includes... /usr/local/include/php
checking for memcached session support... enabled
checking for memcached igbinary support... disabled
checking for memcached msgpack support... disabled
checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=
to specify the prefix where libmemcached headers and library are located ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=no' failed The memcached.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20121212 Tidying /usr/local/lib/php.ini... No changes Tidying /usr/local/cpanel/3rdparty/php/54/etc/php.ini... No changes
and i tried install libmemcached by following these instructions but dindt work :

# wget https://launchpad.net/libmemcached/1.0/1.0.17/+download/libmemcached-1.0.17.tar.gz
# tar xvf libmemcached-1.0.17.tar.gz
# cd libmemcached-1.0.17
# ./configure
# make & make install
 

Michael-Inet

Well-Known Member
Feb 20, 2014
117
15
68
Nashville, TN, USA
cPanel Access Level
Root Administrator
Hello :)

I suggest using the instructions from the thread when installing Memcache:

Memcached Installation

Thank you.
Hi Michael,

Unfortunately those instructions no longer work, nor can I post the below to that thread.


Last edited by cPanelTristan; 05-09-2012 at 02:02 AM. Reason: revised to add posteasyapache script
This no longer works :(

Here's the sequence of steps I've completed, somewhat updated for the times, output is from the second pass.

Box: CENTOS 6.6 x86_64 standard – WHM 11.48.1 (build 1)

Everything as root.


Code:
# yum install libevent
Package libevent-1.4.13-4.el6.x86_64 already installed and latest version

# yum install memcached
Package memcached-1.4.4-3.el6.x86_64 already installed and latest version

# echo "/usr/local/lib/" > /etc/ld.so.conf.d/libevent-x86_64.conf
{no output}

# ldconfig
{no output}

# memcached -d -u nobody -m 1024 127.0.0.1 -p 11211
{no output}

# cd ~
# mkdir junk
# cd junk

Visit:  [url]https://launchpad.net/libmemcached[/url]
Copy the Download link for the latest version (currently 1.0.18)

# wget [url]https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz[/url]
# tar -zxf libmemcached-1.0.18.tar.gz

# cd libmemcached-1.0.18
# ./configure
# make && make install

...
Libraries have been installed in:
   /usr/local/lib
...
 /bin/mkdir -p '/usr/local/include/libmemcached'
 /usr/bin/install -c -m 644  libmemcached/memcached.h libmemcached/memcached.hpp libmemcached/util.h '/usr/local/include/libmemcached'
 /bin/mkdir -p '/usr/local/include/libmemcachedutil-1.0'
 /usr/bin/install -c -m 644  libmemcachedutil-1.0/flush.h libmemcachedutil-1.0/ostream.hpp libmemcachedutil-1.0/pid.h libmemcachedutil-1.0/ping.h libmemcachedutil-1.0/pool.h libmemcachedutil-1.0/util.h libmemcachedutil-1.0/version.h '/usr/local/include/libmemcachedutil-1.0'
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 support/libmemcached.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory `/root/junk/libmemcached-1.0.18'
make[1]: Leaving directory `/root/junk/libmemcached-1.0.18'
Three fails to install memcached:


Code:
# pecl install memcached
{Hit Enter at prompt}

configure: error: no, sasl.h is not available. Run configure with --disable-memcached-sasl to disable this check
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=no' failed



# pecl install memcached
{/usr/local/lib
 at prompt}

checking for libmemcached location... configure: error: Unable to find memcached.h under /usr/local/lib
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=/usr/local/lib' failed


Through WHM 
# Software » Module Installers » PHP Pecl Manage
# Install a PHP Pecl » memcached » Install Now

checking for sasl/sasl.h... no
configure: error: no, sasl.h is not available. Run configure with --disable-memcached-sasl to disable this check
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=no' failed
The memcached.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20090626
Tidying /usr/local/lib/php.ini...
No changes
Tidying /usr/local/cpanel/3rdparty/php/54/etc/php.ini...
No changes
And a couple near random attempts to find a valid(?) memcached.h

Code:
# pecl install memcached
{/usr/local/include/libmemcached
 at prompt}

checking for memcached msgpack support... disabled
checking for libmemcached location... configure: error: Unable to find memcached.h under /usr/local/include/libmemcached
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=/usr/local/include/libmemcached' failed

[email protected] [/usr/local/lib]# ll /usr/local/include/libmemcached/memcached.h
-rw-r--r-- 1 root root 1713 Feb 26 18:05 /usr/local/include/libmemcached/memcached.h


# pecl install memcached
{~/junk/libmemcached-1.0.18
 at prompt}

checking for libmemcached location... configure: error: Unable to find memcached.h under ~/junk/libmemcached-1.0.18
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=~/junk/libmemcached-1.0.18' failed
# # #

So, any clues on why/what the errors are telling us? And how to get memcached to find a memcached.h it likes?

Best,
Michael

(And have someone update Tristan's post with whatever the eventual corrections are.)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
463
Three fails to install memcached:


# pecl install memcached
{Hit Enter at prompt}

configure: error: no, sasl.h is not available. Run configure with --disable-memcached-sasl to disable this check
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=no' failed
Let us know if the issue persists after running the following command:

Code:
yum install cyrus-sasl-devel
Thank you.
 

01i

Member
Nov 16, 2013
11
0
1
cPanel Access Level
Root Administrator
Michael, I am also failing to install pecl memcached with the same sasl error. I have been following through Tristan's guide step by step.

I've tried installing cyrus-sasl-devel via yum, as suggested, but this makes no difference when I try to install pecl memcached for php.

If it makes a difference, I installed the latest versions of libevent (2.0.22 stable), memcached (1.4.23) and libmemcached (1.0.18)

I'm running CENTOS 6.6 x86_64 with WHM 11.48.3 (build 0)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
463
Could you verify the exact steps and commands you have taken thus far so we can attempt to reproduce the issue?

Thank you.
 

cPanelPeter

Technical Analyst III
Staff member
Sep 23, 2013
574
17
143
cPanel Access Level
Root Administrator
Twitter
Hello,

Please note: EasyApache MemCache is the Apache module rather than the PHP module. We do not list or provide the PHP module there.

When you compile EasyApache with the MemCache Apache module, you end up with it available via Apache only and not via PHP. So here are the steps I just used and this worked.

Code:
# cd /root
# wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
# tar -zxvf libmemcached-1.0.18.tar.gz
# cd libmemcached-1.0.18
# ./configure
# make && make install
# pecl install memcached
 

01i

Member
Nov 16, 2013
11
0
1
cPanel Access Level
Root Administrator
Peter,

I am aware of this, perhaps this thread was the wrong choice (based on the opening post), but it seems that Michael-Inet diverted the thread away to an alternative issue. I however, found this thread by googling the error listed by Michael-Inet, of which I have the exact same issue, and have follwed the exact same steps.

"checking for sasl/sasl.h... no
configure: error: no, sasl.h is not available. Run configure with --disable-memcached-sasl to disable this check
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=no' failed"


Michael,

I have run through all of the steps in Tristan's post in this thread (https://forums.cpanel.net/threads/memcached-instalation-memcached-so-missing.257942/)

I had no problems downloading, and compiling libevent or memcached (the apache version)

I had no problems creating the 64bit libevent file

I had no problems running ldconfig and starting the memcached server

Installing and building libmemcached went fine.

The only differences between Tristan's post, and what I downloaded/compiled/installed was the versions of the software, I obviously used the most recent versions, rather than the versions that were recent back in feb 2012).

The issue is when installing the PHP Memcached PECL plugin via the "pecl install memcached" command, or using the PECL GUI in WHM.

When I do this, I get the error relating to SASL.

I have installed Cyrus-Sasl-Devel through yum, as suggested in your reply to Michael-Inet, but this has not resolved the issue.

The SASL error still occurs when attempting to install the PECL memcached classes and functions for PHP.

...... oooh! ......

Actually the SASL error is different now.

It's found sasl.h but notes that libmemcached was built without sasl support

"checking whether libmemcached supports sasl... no
configure: error: no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check
ERROR: `/root/tmp/pear/memcached/configure --with-libmemcached-dir=no' failed"

I've actually resolved the problem.

Cyrus-sasl-devel needs to be installed before libmemcached is compiled.

running

#cd /path/to/libmemcached src
#make uninstall
#./configure
#make && make install
#pecl install memcached

works for me

Tristans post should be updated to require the installation of SASL prior to the installation of libmemcached

e.g.

Next, install libsasl2
Code:
yum install cyrus-sasl-devel
Now, install libmemcached:
Code:
cd ~
wget http://launchpad.net/libmemcached/1.0/1.0.4/+download/libmemcached-1.0.4.tar.gz
tar -zxvf libmemcached-1.0.4.tar.gz
cd libmemcached-1.0.4
./configure
make && make install
pecl install memcached
[edit] I also made a post about this in the thread with Tristan's installation guide
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
463
I am happy to see you were able to address the issue. Thank you for providing us with the updated steps you took to complete the installation.