You are not logged in.

#1 2013-01-20 03:13:11

laertiades
Member
From: Seattle
Registered: 2013-01-20
Posts: 11
Website

How to store php sessions using memcached and unix socket

I am running Arch linux with systemd, nginx, and php with php-fpm. I am trying (and failing) to configure memcached to store sessions using a unix socket. I have memcached installed and active, however, I am unable to disable networking. I added the following line to /etc/conf.d/memcached

MEMCACHED_ARGS="-s unix:///tmp/memcached.sock -a 666"

I also tried:

MEMCACHED_ARGS="-s /tmp/memcached.sock -a 666"
MEMCACHED_ARGS="-s unix:/tmp/memcached.sock -a 666"

when I restart memcached I always get:

memcached.service - Memcached Daemon
          Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled)
          Active: active (running) since Sat 2013-01-19 17:41:15 PST; 5min ago
        Main PID: 773 (memcached)
          CGroup: name=systemd:/system/memcached.service
                  └─773 /usr/bin/memcached -l 127.0.0.1

when I run php script with sessions php error log shows (not surprisingly):

[19-Jan-2013 16:46:45 America/Los_Angeles] PHP Warning:  Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (unix:/tmp/memcached.sock) in Unknown on line 0

I also installed the php-memcached package but I don't what it does or how to get it going. I uncommented the following line in /etc/php/conf.d/memcached.ini:

extension=memcached.so

but that didn't change anything.

Any insights or suggestions would be greatly appreciated.


"Conversation enriches the understanding, but solitude is the school of genius"

Offline

Board footer

Powered by FluxBB