PHP, Memcached works from command line but not from the web
问题 I have PHP 5.3.3 installed on Centos 6.4 with the memcached.so extension, and httpd is running with version 2.2.15-26. Here is my index.php : $mc = new \Memcached(); $mc->addServer('127.0.0.1', 11211); $mc->set("test", "blah"); var_dump($mc->getResultCode()); var_dump($mc->getResultMessage()); var_dump($mc->get("test")); die; When I run it from the command line, it works . I get the following: 10:22:33 $ php index.php int(0) string(7) "SUCCESS" string(4) "blah" The memcache server also works