1
sudo pecl install memcached

It prompts:

libmemcached directory [no] : 

Tried the default value and a lot of different directories and downloaded source. Sure do enjoy these vague error messages.

Where do I find the files it is looking for and what exactly is it looking for?

Searched for hours already and nothing seems to help.

I tried compiling from source, but I ran into a lot of warnings and error messages and to top it off the php-memcached project doesn't seem to contain a configure script.

./configure

"File or directory not found" this is the error. It wants libmemcached directory but I don't know what should be inside of that directory.

I just want it to load in php any way possible. This is on a development VM so it doesn't need to be production ready. Just needs to work.

[Edit]

I have memcache installed but I need memcached instead.

I'm using:

Bitnami lampstack 5.4.29-0 Ubuntu 12.04

[UPDATE]

I found this:

So I recommend to use/install the official memcached extension from PECL and update your application.

https://github.com/kajidai/php-libmemcached

Else you have to install the libmemcached extension from scratch with the following steps:

   download from github
   unpack the file
   go into the new folder
   phpize
   ./configure
   make install
   enable it within you php.ini
   restart you webserver

got to this:

./configure

checking for the location of libmemcached extension... configure: error: Can not find libmemcached headers

More vague error messages.

[UPDATE]

I solved the issue by upgrading to 14.04. Seems that was the fastest route to solve my issue.

jSnake04
  • 113
  • 1
  • 7
  • "Sure do enjoy these vague error messages." -> what vague error messages? What you've pasted there appears to be a configuration prompt. – IMSoP Aug 28 '14 at 20:27
  • Why is the package manager prompting me for a directory with c code? Should it not just download what it needs? – jSnake04 Aug 29 '14 at 06:44
  • ERROR: `/tmp/pear/temp/memcached/configure --with-libmemcached-dir=no' failed Very descriptive? – jSnake04 Aug 29 '14 at 06:47

3 Answers3

5

Install the "libmemcached-devel" package with yum (RHEL/CentOS/CloudLinux) or the "libmemcached-dev" package with apt-get (Debian/Ubuntu).

Once installed, the default answer of "[no]" is fine because the headers will be in the system-wide default location of "/usr/include/libmemcached-1.0", which the configure script will find on its own.

NOTE: You may be tempted to install "memcached-devel", but it is not the same thing as "libmemcached-devel". Between that, and the subtle naming differences between the "memcache" and "memcached" PECL packages, I suspect there are several developers that need to be smacked.

GuyPaddock
  • 2,233
  • 2
  • 23
  • 27
  • I solved the issue by upgrading to 14.04. Not sure what to do with this question on SO. Your answer sounds the best. Seems I am getting all the smacks with down votes. – jSnake04 Feb 20 '15 at 19:56
1

Have you installed memcached?

sudo apt-get install memcached

That should bring in libmemcached. And can you please update your question with "these vague error messages".

fab
  • 1,839
  • 15
  • 21
  • yeah tried the usual tricks. All the other requirements went smoothly. I have memcache installed but I need memcached instead. – jSnake04 Aug 29 '14 at 06:13
  • What is the "sudo pecl install memcached" command looking for? If I knew this I could probably find it. – jSnake04 Aug 29 '14 at 06:27
  • Updated with more info. The vague error message comes down to "file not found" I need to know what it is looking for in order to find it for it. – jSnake04 Sep 14 '14 at 16:19
  • It is trying to automatically detect something to do with the libmemcached's source code header files and doesn't tell me what it is. I guess I have to start digging around in the source of memcached. – jSnake04 Sep 14 '14 at 16:22
0

First run this command

sudo apt-get install memcached

This will install memcached onto your server

To use memcache you must install pear repository which will store memcache

sudo apt-get install php-pear

If you do not have a compiler on your server, you can download build-essential in order to install memcache

sudo apt-get install build-essential

now install

apt-get install php5-dev

and install PECL library

sudo pecl install memcache

Now write memcached extension in your memcache.ini file

sudo echo "extension=memcache.so" > sudo /etc/php5/conf.d/memcache.ini

Here you are done installing memcache, if you want to check whether it is instlled or not type below command

echo "stats settings" | nc localhost 11211

Followed the below article

Install Memcached on Ubuntu

and it worked very well.