Access Denied Unable to establish a PHP session. If you believe that this is in error or inadvertent, contact your system administrator and ask them to review your server settings.
That was the error seen on a phpmyadmin installation on one of my customer servers. It’s related to the phpMyAdmin sessions, which need to be written inside the /tmp directory to work properly.
What causes Access Denied Unable to establish a PHP session PHPMyAdmin error?
This phpmyadmin error is caused usually by wrong file or directory permissions, as well as wrong owner on the /tmp files at this path:
I’ve also seen this error on the general /tmp directory of some plain CentOS servers.
How can I fix it?
For cPanel or DirectAdmin users
Just make sure the directory has the user ownership, you can set the right owner for this file by running:
chown username.username /home/$username/tmp
And let’s make sure the permissions are set to 755, run this command:
chmod 755 /home/$username/tmp
For plain Linux servers (without control panel)
chmod 1777 /tmp
That’s all, your phpmyadmin error should be totally fixed now.