How to install memcache over ubuntu server ?

Asked By 200 points N/A Posted on -
qa-featured

I'm using Ubuntu Server and have Apache with php5 all running nice. I have installed: apt-get install php5-memcache. I also have memcached installed: apt-get install memcached. Memcached is running fine, I checked with netstat -tap. I want to use memcached from php scripts. I entered $memcache = new Memcache; in a php script and of course I get an error about the Memcache object. Next, pretend like I a complete noob and tell me step by step how to get php to communicate with memcached. I found this blurb in the php memcached page:

/////////////
So, the steps:
First – ./configure with –enable-memcache. This should show in your phpinfo() at the top (even though nothing of the memcache extension works yet).
Second:
either pecl install memcache
OR
download the source
tar -xzvf [thesourcetarball]
phpize
./configure
make
make install
Finally: Add extension=memcache.so to your php.ini. (If you don't have one, it should go in the root of where php is called ie., /usr/local/lib)
/////////////
MY QUESTIONS:
1) Memcached does not show up in my phpinfo(). I have no idea how or where to configure php to support memcached. How do I do this?
2) Is there a php.ini script by default install on Ubuntu Server? If so where is it located please.
3) Anything else I need to know?

Thanks.

SHARE
Best Answer by khantm
Answered By 0 points N/A #86774

How to install memcache over ubuntu server ?

qa-featured

By installing the Php5 memcache package perfectly, it will create a default configuration and add a file memcache.ini at /etc/php5/conf.d/, this is where all php extension packages keep their ini files so that they can be read. If you check that file, you will see the line: extension=memcache. Which is commented with a semicolon before it, when this is uncommented, the memcache becomes available for you to change other setting configuration in the file as you deem fit.

Best Answer
Best Answer
Answered By 0 points N/A #86775

How to install memcache over ubuntu server ?

qa-featured
Hi jhon,
 
I have faced same that problem long time ago, let me explain how I resolve it. When installing php5 memcache it will automatically append the configuration to the /etc/php5/apache2/php.ini file. It loads this extension: "-e extension=memcache.so"
Remove the -e to make it working. Took me a while to figure it out but it works now.

Related Questions