Solving phpMyAdmin login issue with PHP-FPM/NGINX

If you are using multiple PHP-FPM configs you might have been unable to login to phpMyAdmin or similar software using cookie based auth.  The problem is with the session.save_path normally set in the PHP.ini.  This is set in the PHP-FPM config. Servers with per site configs containing multiple users or usergroups may be trying to use the same directory.  The problem comes from this directories owner or group not matching that of the site trying to use it.

Check the config for each site. The default is www.conf which depending on your install may be in /etc/php-fpm.d/:

; Set session path to a directory owned by process user
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session
php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache

The default group for my install was apache and the save path specified was owned by root:apache.  On a single config site you can chown this directory to the proper owner.  On a multiple config site the best option is to create a new directory per site and chown to that sites php handler user/group.

You may wish to use the test script in this wiki article to find what path is set –