6

When I try to login to PHPmyadmin, I get the following error:

phpMyAdmin - Error
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.

I tried to fix by changing permissions of the /tmp (listed as sessions path in php.ini) to 755, then tried 777.

I also tried changing user and group ownership with chown to www-data. (www-data listed as user for php-fpm and Nginx).

Tried multiple web browsers, deleting cookies, deleting all session files from server's /tmp folder.

PHP info shows sessions loaded. Not sure what else it could be, all other areas of the site load perfect and there's nothing in error logs related.

Is this something you are familiar with?

Hayden
  • 161

6 Answers6

2

I had the same issue and resolved it with the following command:

sudo chmod 777 /var/lib/php/session/
Gareth
  • 19,080
Qaisar Ali
  • 39
  • 1
2

PHP "sessions" store variables so they can persist across multiple HTTP requests.

PHP sends your browser a single cookie that serves as a key. The key is used to retrieve the values from server-side storage.

By default, PHP uses files to store session data on the webserver (which in your case is actually your local PC). Your error indicates that your webserver can't retrieve the file, so it can't restore the variables, and phpMyAdmin can't proceed.

This is likely due to filesystem permissions issues on your local PC.

Do following things

Try to open phpmyadmin in another browser. If it opens then it means it is related with your browser cache memory so try to delete cache and temp files of your browser then restart your wampsever.

Second thing, If the first one fails, try to delete session files of phpmyadmin which is located in C:/wamp/tmp. Do not delete the temp folder but the content inside the temp folder.

Restart your wampsever and it will work.

1

Also check your session.save_handler value in your php.ini. I got this error when I changed it to memcached, and worked again when changing back to files.

0

In my ubuntu, I resolved by @Qaisar Ali's answer. But the path is different.

sudo chmod 777 /var/lib/php/sessions/
0

Anyone who faces this issue in WAMP server, the value of "session.save_path" in php.ini could be wrong.

0

Solution for cPanel / WHM

Understanding through some of the other solutions that the problem could be in the CHMOD permissions of the folder that stores the PHP sessions (/var/cpanel/php/sessions/ea-php83 in our case), we tryed to indicate the folder of an older PHP version for the PHP.ini session.save_path variable (/var/cpanel/php/sessions/ea-php74 in our case), and it worked perfectly.

So, it's working temporarily for us, but as the older PHP is being deprecated, we are telling our Data Center administrators they should allow PHP8 session folders to store the sessions, probably by globlally running a command similar to:

sudo chmod 777 /var/cpanel/php/sessions/ea-php81

Hope this helps someone.