Is it possible to connect zf1 and memcached using unix socket?

423 Views Asked by At

Currently moving legacy code to the new server. My environment is configured to use only sockets.

Perhaps it is possible to configure zend framework 1 to use unix socket to connect to memcached server?

P.S. Not to confuse people: question is not regarding native php sessions mechanism, but ZF1 caching one.

e.g. we specify something like the following in application.ini (i need something for unix sockets, if there is some workaround):

; Cache
resources.cachemanager.database.frontend.name                            = Core
resources.cachemanager.database.frontend.options.automatic_serialization = On
resources.cachemanager.database.backend.name                             = Memcached
resources.cachemanager.database.backend.options.servers.local.host       = <%= @memcached['listen'] %>
resources.cachemanager.database.backend.options.servers.local.port       = <%= @memcached['port'] %>

I can't see anything that would work with memcached unix sockets in zf1 code, but perhaps someone could advice some painless workaround..

1

There are 1 best solutions below

0
datasage On

The ZF1 class should be using the Memcached class. It appears that it will take a socket path in place of host with a port of 0.

http://php.net/manual/en/memcached.addserver.php