I've got an odd issue with sessions in my app. The app is running within docker containers. In essence everything within the Dockerfile's and entrypoint-php.sh
files sets things up fine. The php.ini settings for sessions is as follows:
session.save_path = /tmp
session.use_strict_mode = 1
session.name = K2CLOCATION
session.auto_start = 0
session.cache_expire = 240
session.hash_function = sha256
but when I hit the index.php file I get the warning
Warning: session_start(): open(/tmp/php/session/1/b/f/sess_1bf0f6fcf5413365a2e5540be2f40b58f0f21b5c16d2214257a5303650649715, O_RDWR) failed: No such file or directory (2) in /var/www/k2c/v03/agent_v07/index.php on line 3
If I then edit the index.php file at the top and add ini_set('session.save_path', '/tmp');
above session_start();
everything works and I can see the sessions been written.
The /tmp/php/session folder has 777 permissions. It was originally owned by root and I attempted to change this to the PHP user (nobody:nobody
) but this also had no effect.
Other things I have tried:
I tried moving the sessions folder to somewhere completely removed from the system tmp folder and this resulted in no change.
Drive space is only 9% used.
System info:
PHP5.6
Running dockerized Centos with Nginx