PHP:未知:无法写入会话数据(memcache)

时间:2014-11-02 01:10:31

标签: php memcached

我在php中使用memcached存储会话,并在php错误日志中看到以下内容:

[31-Oct-2014 03:33:11 UTC] PHP Warning:  Unknown: Failed to write session data (memcache). Please verify that the current setting of session.save_path is correct (tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=3) in Unknown on line 0

这是memcached.conf:

  # Memcached Configuration Settings

# IP address to listen on
# The default is INARR_ANY, any network interface
HOST="127.0.0.1"

# TCP port to listen on
# The default is 11211
TCP_PORT="11211"

# UDP port to listen on
# Can be disabled by setting it to 0.
# The default is 11211
UDP_PORT="11211"

# Unix socket path to listen on
# Using a socket will automatically disable networking support.
# The default is /var/run/memcached/memcached.sock
SOCKET=""

# Client binding protocol
# Available options: auto, ascii, binary
# The default is auto
PROTOCOL="auto"

# Number of threads used to process incoming requests
# Not useful to set higher than the number of server CPU cores.
# The default is 4
THREADS="4"

# Maximum memory to use for object storage
# The default is 64 megabytes
MAX_BYTES="128"

# Maximum simultaneous connections
# The default is 1024
MAX_CONNECTIONS="2048"

# Maximum sequential requests
# Prevents client starvation by setting a limit to the number
# of requests the server will process from a client connection.
# The default is 20
MAX_REQUESTS="50"

# Multiplier factor for computing the size of item memory chunks
# The default is 1.25
CHUNK_FACTOR="1.25"

# Minimum number of bytes for an item memory chunk
# The default is 48 bytes
CHUNK_SIZE="48"

# Default size of each slab page
# Adjusting this value changes the item size limit, increases
# the number of slabs and overal memory usage.
# Choose a value between is 1 kilobyte and 128 megabytes.
# The default is 1 megabyte
SLAB_SIZE="1m"

# Additional server options
OPTIONS=""

知道我能做些什么来解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

将持久性切换为关闭,为我们解决了问题。

tcp://localhost:11211?persistent=0