使用 Amazon Linux 在 AWS 上使用 php 5.4 运行应用程序。
PHP 版本是 PHP 5.4.28。从 AWS 存储库安装的 memcache 库是 php54-pecl-memcache-3.0.8-1.11.amzn1.x86_64
我已经验证 php 正在使用 /etc/php.ini:
[root@ip-xx.xx.xx.xx]# php -i | grep Config
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
该设置表明我应该使用 memcache:
[root@ip-10-40-17-119 etc]# grep "^session.save" php.ini
session.save_handler="memcache"
session.save_path="tcp://<elasticache-endpoint>:11211"
[root@ip-10-40-17-119 php.d]# php -i | grep session.save
session.save_handler => memcache => memcache
session.save_path => tcp://<elasicache-endpoint>:11211?persistent=1&weight=1&timeout=1&retry_interval=15 => tcp://<elasticache-endpoint>:11211?persistent=1&weight=1&timeout=1&retry_interval=15
我可以从盒子远程登录到端点和端口并正确连接,因此实例能够连接到 memcached 服务器。
我们尝试过的事情:
- 我已经从 php.ini 文件中删除了 tcp://,这并没有什么不同——会话仍然保存在文件中。
- 我们已从 session.save_handler="memcache" 更改为 session.save_handler="memcached"
- 每次我们进行更改时,我们都会停止 httpd 服务器,然后重新启动它
- 我们甚至尝试重新启动服务器
无论我们尝试过什么,会话都存储在磁盘上的 /var/lib/php/sessions 中。是否有我遗漏的东西,或者这是一个已知的 5.4 或 AWS 问题?