how can install MemCached ? thanks

Started by eddyngan, December 28, 2014, 05:54:52 AM

Previous topic - Next topic

eddyngan


Glenn


Qefx

Hello,

I´m trying to find out too how to install memcache/d . Memcached itself is no problem. But how do I get it into PHP? I guess I need to recompile. --with-memcache or memcached option? But where do I need to put the files needed for recompile?

Administrator

this will not work wit suphp, you have varnish which is the best caching server integrated into CWP

Qefx

I´m using WP-FFPC with memcache and wp-object cache for wordpress, turned down my logged in user network time by one second :) I compiled it my self and added it as an .so link to php.

But this product is amazing nonetheless

PS.: I´m using it with varnish, pound and apache/php hehe. :)

timworx

Qefc - what exactly do you mean by it "turned down my logged in user network time by one second"?

Does this mean it has sped up your response/load time for WP sites? I would definitely be interested in what you did if that's the case!

matus

If you need it, do the following wich works perfectly on my CentOS Server with cwp.

Quote
yum install memcached libevent libevent-devel nc -y
cd /usr/src/
wget http://pecl.php.net/get/memcached-2.2.0.tgz
tar -zxvf memcached-2.2.0.tgz
cd memcached-2.2.0/
phpize
./configure
make && make install

open /usr/local/php/php.ini and add: "extension=/usr/src/memcached-2.2.0/modules/memcached.so"
service httpd reload

brijendrasial

atleast memcahce is not meant to work wit cwp.

danrimer

Hello

Mine fails at the ./configure stage
error is:
checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix where libmemcached headers and library are located

I'm a noob at this, so any help appreciated!


all the best

Dan

Igor S.

Quote from: danrimer on July 29, 2015, 09:05:18 AM
Hello

Mine fails at the ./configure stage
error is:
checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix where libmemcached headers and library are located

I'm a noob at this, so any help appreciated!


all the best

Dan


Hi,

try to comile it with the option: --with-libmemcached-dir or --with-libmemcached-dir=/usr



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services


Igor S.

#11
Hello everybody.

Who want to install php pecl memcached with the CWP should use old libmemcached.
See below for instruction:

1. Install Webtatic repo and libmemcached:
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install libmemcached10-devel

2. Get and unpack pecl memcached


cd /usr/local/src
pecl download memcached
tar -xf memcached-{downloaded_version}.tgz


3. Compile it

cd memcached-{downloaded_version}/
/usr/local/bin/phpize
./configure
make


4. Install it

mkdir -p `php -c date.timezone=utc -i |grep -i no-debug-non |awk '{print $3}'`
cp modules/memcached.so  `php -c date.timezone=utc -i |grep -i no-debug-non |awk '{print $3}'`
echo "extension=memcached.so" >> /usr/local/php/php.ini
/etc/init.d/httpd restart


5. Enjoy!



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

aicon

In case anyone wants $10 bonus for FREE on cheap cloud VPS from Vultr:
http://www.vultr.com/?ref=6855695
-------------------------------------------------------------------------------------------------
And $10 bonus for FREE on cheap cloud VPS from Digitalocean:
https://www.digitalocean.com/?refcode=c41029801394

ozgur

Quote from: Igor S. on November 24, 2015, 12:50:19 PM
Hello everybody.

Who want to install php pecl memcached with the CWP should use old libmemcached.
See below for instruction:

1. Install Webtatic repo and libmemcached:
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install libmemcached10-devel

2. Get and unpack pecl memcached


cd /usr/local/src
pecl download memcached
tar -xf memcached-{downloaded_version}.tgz


3. Compile it

cd memcached-{downloaded_version}/
/usr/local/bin/phpize
./configure
make


4. Install it

mkdir -p `php -c date.timezone=utc -i |grep -i no-debug-non |awk '{print $3}'`
cp modules/memcached.so  `php -c date.timezone=utc -i |grep -i no-debug-non |awk '{print $3}'`
echo "extension=memcached.so" >> /usr/local/php/php.ini
/etc/init.d/httpd restart


5. Enjoy!

Hi, I followed these steps, and it worked for me.

However, I couldn't find editing cache size of memcached system.
I only found this file /usr/local/src/memcached-2.2.0/memcached.ini but no option for cache limit.
When I print Memcached::getStats() method in PHP file, I see [limit_maxbytes] => 536870912 (512 MB)

Nevertheless I couldn't find right command for restarting memcached.

I use Centos 6.7 and CWP.
Does anyone know solution for these?
Thanks


ozgur

Hi again,

I misconfigured first, but then I found solutions for my problems via mixing method.

I followed these steps:
1. Install Webtatic repo and libmemcached:
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install libmemcached10-devel
2. Install memcached libevent and compile it
yum install memcached libevent libevent-devel nc -y
cd /usr/src/
wget http://pecl.php.net/get/memcached-2.2.0.tgz
tar -zxvf memcached-2.2.0.tgz
cd memcached-2.2.0/
phpize
./configure
(if command does not work, try with this: "./configure --with-libmemcached-dir")
make && make install
3. open /usr/local/php/php.ini and add to the bottom: "extension=/usr/src/memcached-2.2.0/modules/memcached.so" without quotation marks
service httpd reload
4. Configure memcached
vi /etc/sysconfig/memcached
5. Restart memcached
/etc/init.d/memcached restart


We can configure memcached settings as:

vi /etc/sysconfig/memcached

PORT="11211"
USER="memcached"
# max connection 1024
MAXCONN="1024"
# set ram size to 512 MB
CACHESIZE="512"
# listen to loopback ip 127.0.0.1, for network connection use real ip e.g., 10.0.0.4
OPTIONS="-l 127.0.0.1"


Moreover, If we need to increase timeout from 65535 seconds to almost 1 year (because, we can get this error while writing: "udf_flags will be limited to 65535") to store data in memcached, I edited and recomplied c code like this:
vi /usr/src/memcached-2.2.0/php_memcached.c
change this line (16 means 2^16 seconds):
"#define MEMC_VAL_USER_FLAGS_MAX ((1 << 16) - 1)"
with this line (25 means 2^25 seconds):
"#define MEMC_VAL_USER_FLAGS_MAX ((1 << 25) - 1)"
and turn phpize step and continue again.


Hope to help someone.