phpMyAdmin session_start() Permission denied – How To Fix

phpMyAdmin session_start() Permission denied is one of the most common errors that appears in this MySQL database manager.

The error appears when you try to log in to phpMyAdmin, appearing many times after updates of the PHP packages.

phpMyAdmin session_start() Permission denied
phpMyAdmin Error
Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly.
Also ensure that cookies are enabled in your browser.
session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)
session_start(): Failed to read session data: files (path: /var/lib/php/session)

Fortunately, this error that appears when logging into phpMyAdmin has a very easy solution. But for that you need access to the host server.

Fix phpMyAdmin session_start() Permission denied

The error is generated by the lack of write permissions in the block of directories from /var/lib/php/session. There can be two drawbacks:

1. chmod no write permissions in /var/lib/php/session

2. Directories from /var/lib/php/session belong to another owner:group, than the one that serves the PHP / web processes.

For example, if you have a web server with NGINX, and the phpMyAdmin scripts are run under the user "nginx", it is possible that one follows one update of PHP, the session directories should be passed under user: apache. For this reason there will be no write permissions of PHP sessions.

To solve this phpMyAdmin error, follow the steps below:

1. Assuming that phpMyAdmin is run by the user "nginx", execute the command:

ls -all /var/lib/php/

This command will list the directories in PHP, together with information about the owner and group.

2. Set write permissions for user "nginx" in /var/lib/php/.

chown -R root:nginx /var/lib/php/
chown - Change owner - group in Linux
chown - Change owner - group in Linux

After this step, refresh the login page on phpMyAdmin. Enter the database user you want to connect to and the password. Everything should work without problems. Leave a comment below if you need help.

Passionate about technology, I enjoy writing on since 2006. I have a rich experience in operating systems: macOS, Windows, and Linux, as well as in programming languages and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, PrestaShop).

How to » Linux » MySQL » phpMyAdmin session_start() Permission denied – How To Fix
Leave a Comment