Cannot start session without errors in phpMyAdmin
Solution 1
Problem usually lies on your browser end.
You need to flush your browser cache, delete the cookies for the server/host and then retry loading phpMyAdmin.
If you want to go all out, clear out the session folder on the server as well.
One possible reason for this is a session data mismatch between the browser and the webserver causing it to not be able to pull out the required session info and dumping this error dialogue on your lap.
Solution 2
The problem can be due to file and folder permissions; You can try changing the folder permissions:
sudo chmod 777 /var/lib/php/session/
This will set full read/write permissions on the PHP sessions folder.
Note: the php/session/
folder may be in a different location on some servers. Check your php.ini
for your session path.
Solution 3
In my case it was the wrong ownership for /var/lib/php/session
. I changed that to the Apache user and group (the user and group that the webserver runs as) and all was well.
Solution 4
STOP 777
!
If you use nginx (like me), just change the ownership of the folders under /var/lib/php/
from apache
to nginx
:
[root@centos ~]# cd /var/lib/php/
[root@centos php]# ll
total 12
drwxrwx---. 2 root apache 4096 Jan 30 16:23 opcache
drwxrwx---. 2 root apache 4096 Feb 5 20:56 session
drwxrwx---. 2 root apache 4096 Jan 30 16:23 wsdlcache
[root@centos php]# chown -R :nginx opcache/
[root@centos php]# chown -R :nginx session/
[root@centos php]# chown -R :nginx wsdlcache/
[root@centos php]# ll
total 12
drwxrwx---. 2 root nginx 4096 Jan 30 16:23 opcache
drwxrwx---. 2 root nginx 4096 Feb 5 20:56 session
drwxrwx---. 2 root nginx 4096 Jan 30 16:23 wsdlcache
And also for the folders under /var/lib/phpMyAdmin/
:
[root@centos php]# cd /var/lib/phpMyAdmin
[root@centos phpMyAdmin]# ll
total 12
drwxr-x---. 2 apache apache 4096 Dec 23 20:29 config
drwxr-x---. 2 apache apache 4096 Dec 23 20:29 save
drwxr-x---. 2 apache apache 4096 Dec 23 20:29 upload
[root@centos phpMyAdmin]# chown -R nginx:nginx config/
[root@centos phpMyAdmin]# chown -R nginx:nginx save/
[root@centos phpMyAdmin]# chown -R nginx:nginx upload/
[root@centos phpMyAdmin]# ll
total 12
drwxr-x---. 2 nginx nginx 4096 Dec 23 20:29 config
drwxr-x---. 2 nginx nginx 4096 Dec 23 20:29 save
drwxr-x---. 2 nginx nginx 4096 Dec 23 20:29 upload
Solution 5
Set the session.save_path
in your php.ini
. Make sure that you are using an existing directory.
If still you found any issue then give write & execution permission to that folder for the user by which you are going to use that folder.[This is specially used in case of IIS]
rciiipo
Updated on July 09, 2021Comments
-
rciiipo almost 3 years
I get the below error when pointing browser to phpMyAdmin
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
I have checked everything and can't seem to figure out what the problem is.
In my php.ini file I have:
session.save_path = "/var/lib/php/session"
Permissions:
drwxr-xr-x 2 root apache 4096 Feb 16 04:47 session
Nothing seems to work. Even changing permission on session directory to 777.
-
shasi kanth over 11 yearsWell, in my case, i have no 'tmp' directory on the host, where the Apache is storing the session data.
-
RiggsFolly about 10 yearsFirefox - Clear cache =
CRTL+F5
-
JonnyB about 10 yearsThis is what I had to do after ensuring the above recommendations were followed. On my EC2 server, somehow my /var/lib/php/session directory ownership was set to the incorrect user:group.
-
davidkonrad over 9 yearshey @shasi - do a
<? phpinfo(); ?>
and look forsession.save_path
. -
slick1537 over 9 yearsThis answer worked for me. They were owned by Apache but I was using nginx.
-
Edward over 8 yearsI had to set my session folder to 777
sudo chmod 777 -R /var/lib/php5
as well as clearing my cache ctrl + F5 -
shelbypereira about 8 yearsThis answer was most of the solution in my case. I had a separate phpmyadmin open. (I wanted 2 windows, 1 for local and 1 for remote). By closing one window AND clearing the browser cache, the error went away.
-
Abel Callejo over 5 yearsThis is good for an instant/temporary fix. Using
777
privilege is overkill. This answer just debugs that "maybe you just don't have enough permissions" and you can try it by doingsudo chmod 777 /var/lib/php/session/
. -
Hidayt Rahman about 5 yearsthis method didn't work for me, I also tried to remove some unnecessary .zip file from file manager but still the same error
-
N'Bayramberdiyev almost 5 years@shasikanth, Creating
tmp
directory solved my issue. -
user2912903 almost 5 yearsMaybe better putting the apache into the right group.
-
Jigar7521 almost 5 yearsI think this is better solution
-
hassanzadeh.sd about 4 yearsyou have to set permission for tmp directory
chmod 777 tmp
-
misterzik about 3 yearsGreat answer, 777 will leave the doors open for the bad guys to mess with your system if they get some type of leverage, stay away unless working locally...
-
Melroy van den Berg about 2 yearsI think it should be
www-data