php - memcached:解析 session.save_path 失败
问题描述
我正在尝试设置memcached
为使用 PHP
我已经安装并确认可以使用php -i | grep memcached
我正在运行一个简单的 php 文件来测试 memcached:
<?php
session_start();
$_SESSION['some'] = 'thing';
echo session_id()."\n";
print_r($_SESSION);
当我运行它时,我得到一个错误:
Warning: session_start(): failed to parse session.save_path in /Applications/XAMPP/xamppfiles/htdocs/public_html/session/s.php on line 2
PHP Warning: session_start(): Failed to initialize storage module: memcached (path: tcp://localhost:11211) in /Applications/XAMPP/xamppfiles/htdocs/public_html/session/s.php on line 2
Warning: session_start(): Failed to initialize storage module: memcached (path: tcp://localhost:11211) in /Applications/XAMPP/xamppfiles/htdocs/public_html/session/s.php on line 2
我找到了将 save_path 设置为此的建议:
session.save_path="tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
但错误仍然存在。
这是我的 php.ini 的一部分
session.save_handler=memcached
session.save_path="tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
内存缓存部分
Version 3.0.4
libmemcached version 1.0.18
SASL support yes
Session support yes
igbinary support no
json support no
msgpack support no
memcached.compression_factor 1.3 1.3
memcached.compression_threshold 2000 2000
memcached.compression_type fastlz fastlz
memcached.default_binary_protocol 0 0
memcached.default_connect_timeout 0 0
memcached.default_consistent_hash 0 0
memcached.serializer php php
memcached.sess_binary_protocol 1 1
memcached.sess_connect_timeout 0 0
memcached.sess_consistent_hash 1 1
memcached.sess_lock_expire 0 0
memcached.sess_lock_max_wait not set not set
memcached.sess_lock_retries 5 5
memcached.sess_lock_wait not set not set
memcached.sess_lock_wait_max 2000 2000
memcached.sess_lock_wait_min 1000 1000
memcached.sess_locking 1 1
memcached.sess_number_of_replicas 0 0
memcached.sess_persistent 0 0
memcached.sess_prefix memc.sess. memc.sess.
memcached.sess_randomize_replica_read 0 0
memcached.sess_remove_failed_servers 0 0
memcached.sess_sasl_password no value no value
memcached.sess_sasl_username no value no value
memcached.sess_server_failure_limit 0 0
memcached.store_retry_count 2 2
端口 11211 已打开:
$netstat -ap tcp | grep -i "listen"
tcp4 0 0 *.11211 *.* LISTEN
tcp6 0 0 *.11211 *.* LISTEN
我应该怎么做才能解决这个问题?
解决方案
推荐阅读
- ethereum - 相同的智能合约文件,大小不同?
- xamarin - 减小视频文件大小
- node.js - 如何同时使用 node-ipc 和 express
- android - WifiP2P 在对等点发现上给出不一致的结果
- c++ - 如何将向量转换为矩阵 C++ vec2mat
- c# - 如何在用户屏幕的特定坐标处截屏并将其保存为example.jpeg c#?
- v8 - 为什么 JS 工厂/闭包比构造函数/原型慢得多?
- python - 矩阵减法类似于张量流中的矩阵乘法
- php - Laravel webdav和文件系统无法访问驱动器
- javascript - 我应该为这个 Tampermonkey 脚本选择哪个元素?还是可以等到所有内容加载完毕?