1

How to set the two different memcache for two different PHP application in One server(windows and linux)

I know how to set for single application.But i am not able to configure for two different PHP application. So please guide me anyone who is good in memcached.

1 Answer 1

2

You can use different ports, for example:

$memcache = new Memcache;
$memcache->connect('memcache_host', 11211);

$memcache = new Memcache;
$memcache->connect('memcache_host', 11212);

And run memcached using different ports, like this (for linux):

memcached -p 11211 -d
memcached -p 11212 -d

Hope it helps.

Sign up to request clarification or add additional context in comments.

5 Comments

Different ports, good solution. But IMO Memcached is better (use Memcached::addServers(Array)): us2.php.net/manual/en/memcached.addservers.php
Do We need to do any additional settings in php.ini file.
No, only enable memchache extension.
Thanks! Dan & krayton i will check and if any issues comes add it again in the conversation
Btw, if you don't wana run several memcached instances, you can just use different keys prefixes for your applications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.