netstat -an | grep 11211
gives me 
tcp        0      0 127.0.0.1:11211             0.0.0.0:*                   
LISTEN      
udp        0      0 127.0.0.1:11211             0.0.0.0:* 

I've also added the rule to iptables as shown below
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp 
dpt:memcache 

I am able to telnet and check version, stats of memcache via command
telnet 127.0.0.1 11211

However, I am not able to reach memcached via the browser.
i.e. this line "memcache->connect('localhost', 11211) " returns false. 

Where did I forgot to set? How come I am able to telnet to memcached, but 
not via the browser? 

Any insight welcome. I am stuck here for two days...

BTW, I pecl installed memcache. I tried memcached but got a bunch of 
errors. "make failed". 
What exactly is the difference, and which is recommended?

P.S.  I was following this instruction
http://www.webdeveloperjuice.com/2010/01/25/10-baby-steps-to-install-memcached-server-and-access-it-with-php/


Thanks,
Xun

On Monday, April 25, 2011 6:00:05 AM UTC-7, rspadim wrote:
>
> humm try to run memcache daemon, and
> netstat -an | grep 11211
>
> to check if port is open or not
>
> 2011/4/25 Dan Golob <[email protected] <javascript:>>:
> > I have tried connecting both via localhost and 127.0.0.1 ... same 
> results.
> > I connected to telnet from the same machine, using 'telnet 
> localhost:11211'
> > ... not too familiar with telnet, to be honest, but I connected to 
> something
> > and couldn't figure out how to get out.
> > The php error logs only have those two that I mentioned ... just can't
> > connect:
> > [24-Apr-2011 17:15:01] PHP Warning:  Module 'memcache' already loaded in
> > Unknown on line 0
> > [24-Apr-2011 17:15:01] PHP Notice:  Memcache::connect(): Server localhost
> > (tcp 11211) failed with: Connection refused (111) in
> > /var/www/html/mizozo.com/algorithm.php on line 131
> > I have been avoiding the firewall, because for one I know little about 
> it,
> > but also because since I am connecting locally and didn't think that the
> > firewall would be a problem. Maybe this is the reason?
> > Also, is there a way that I can be sure to remove everything so that I 
> can
> > start from scratch? I probably installed one too many (or 3 too many)
> > modules, some may be conflicting. For example, if I had installed 
> memcached
> > and pecl's version, would they work in unison or break one another? As I 
> had
> > mentioned before, at this point I have no idea what I installed ... I 
> have
> > gone through so many different instruction sets that anything is 
> possible. I
> > try to remove things, but often get caught up in the moment and forget.
> > Thanks for all your help, by the way
> >
> > On Sun, Apr 24, 2011 at 10:24 PM, Geoffrey Hoffman
> > <[email protected] <javascript:>> wrote:
> >>
> >> Sorry, I see you provided error output.
> >> Connection refused, eh?
> >> Are you connecting to localhost or another server running memcached?
> >> Try opening port 11211 with iptables (if CentOS - did you say what 
> distro
> >> you are using?)
> >
> >
> > --
> > My Mizozo Profile -
> > http://shark.mizozo.com/
> >
>
> -- 
> Roberto Spadim
> Spadim Technology / SPAEmpresarial
>
>

Reply via email to