I'm developing with PHP 5.5.25 and Apache 2.4.16 on a Windows machine. I'd like to use a Memcached server to manage Sessions, and the memcache (not Memcached) PHP extension to interact with the server. The problem is that when I try to start a session I get error Cannot find save handler 'memcache' - session startup failed
I have installed the Memacached server and believe it is running properly: in PHP, I can interact with it by saving to and retrieving data from the cache, querying the version number etc... My Firewall also shows that memcached.exe is listening on port 11211. So far so good.
php.ini
; the DLL is present in the extensions directory
extension=php_memcache.dll
; commented out to avoid having 2 session.save_handlers
; session.save_handler = files
; this is correct. I am using memcache, not memcached extension
session.save_handler = memcache
; the protocol tcp:// is required for memcache
session.save_path = "tcp://127.0.0.1:11211"
Searching around the web, I've seen the following solutions:
- Use
session.save_handler = memcached. This does not work; my extension ismemcache - Remove
tcp://from the save path. This is good formemcached, but I'm usingmemcache
In phpinfo's session section, the value of Registered save handlers is files user when it should really be files user memcache. I can't figure out why the memcache extension is not listed here even though phpinfo shows that session.save_handler has Local value memcache and Master value memcache.
Please remember that:
- although session start fails, I can interact with the Memcached server in PHP so I know that memcache extension can communicate with Memcached server, and that the memcache class methods are recognized by the PHP parser.
- I'm working on Windows, and am not using WAMP, MAMP or the like. Just plain Apache with a reference to the PHP binary
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire