Amazon Linux を使用して、AWS で php 5.4 を使用してアプリケーションを実行します。
PHP のバージョンは PHP 5.4.28 です。AWS リポジトリからインストールされた memcache lib は、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
ボックスからエンドポイントとポートに telnet で接続して適切に接続できるため、インスタンスは memcached サーバーに接続できます。
私たちが試したこと:
- tcp:// を php.ini ファイルから削除しましたが、違いはありませんでした。セッションはまだファイルに保存されています。
- session.save_handler="memcache" から session.save_handler="memcached" に変更しました
- 変更を加えるたびに、httpd サーバーを停止し、再度開始します。
- サーバーの再起動も試みました
何を試しても、セッションはディスク上の /var/lib/php/sessions に保存されます。不足しているものはありますか、それとも 5.4 または AWS の既知の問題ですか?