tags:

views:

170

answers:

2

What in the heck do you put as the host for Memcache::addServer($host, $port)?

I am hosting on mediatemple and this is really, really, really, really starting to get to me.

Do I have to set up a new memcahce server or what. I have no idea what to do and every tut just keeps saying "localhost". Well I don't want to run it on my localhost.... I guess I just don't understand what's going on.

Any help would be greatly appreciated.

+1  A: 

"localhost" is whatever machine the code is running on. If the code is running on a server at MediaTemple, then "localhost" will be that server.

If they provide a memcache server, they should provide it's address somewhere in their knowledge base. Try "localhost" first, on the off chance that it's running on the same machine your site is hosted on.

UPDATE

Assuming you're running on their Grid service, try following these instructions: http://kb.mediatemple.net/questions/854/Using+memcached+with+Django+or+Ruby+on+Rails+in+a+(gc)+GridContainer

meagar
I mean yeah... but what is "that server". Is it domain.com? Is it ftp.domain.com? Is it youcantmemcache.localhost.thatserver? I've tried every listed address, IP or otherwise, that is available to me and keep getting a connection refused error
bschaeffer
It's very likely that there is no memcache server available to you, unless you've specifically configured one. Why are you trying to use memcache in the first place?
meagar
I was just going to test it to see what it's all about. I don't think there is a Memcache server setup. I'll try localhost, but I guess it's not really a big deal.
bschaeffer
+1  A: 

Memcached is a service that provides access to a centralized RAM store which would enable caching for your application. Its default port is 11211. If your application requires it then it sounds like you will need access to one.

Most of the time though it's only used for caching and not having it means it will access your database for every request which can degrade your performance significantly depending on your scenario.

mythz