Cannot start session without errors in phpMyAdmin

253,900

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]

Share:
253,900
rciiipo
Author by

rciiipo

Updated on July 09, 2021

Comments

  • rciiipo
    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
    shasi kanth over 11 years
    Well, in my case, i have no 'tmp' directory on the host, where the Apache is storing the session data.
  • RiggsFolly
    RiggsFolly about 10 years
    Firefox - Clear cache = CRTL+F5
  • JonnyB
    JonnyB about 10 years
    This 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
    davidkonrad over 9 years
    hey @shasi - do a <? phpinfo(); ?> and look for session.save_path.
  • slick1537
    slick1537 over 9 years
    This answer worked for me. They were owned by Apache but I was using nginx.
  • Edward
    Edward over 8 years
    I had to set my session folder to 777 sudo chmod 777 -R /var/lib/php5 as well as clearing my cache ctrl + F5
  • shelbypereira
    shelbypereira about 8 years
    This 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
    Abel Callejo over 5 years
    This 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 doing sudo chmod 777 /var/lib/php/session/.
  • Hidayt Rahman
    Hidayt Rahman about 5 years
    this 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
    N'Bayramberdiyev almost 5 years
    @shasikanth, Creating tmp directory solved my issue.
  • user2912903
    user2912903 almost 5 years
    Maybe better putting the apache into the right group.
  • Jigar7521
    Jigar7521 almost 5 years
    I think this is better solution
  • hassanzadeh.sd
    hassanzadeh.sd about 4 years
    you have to set permission for tmp directory chmod 777 tmp
  • misterzik
    misterzik about 3 years
    Great 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
    Melroy van den Berg about 2 years
    I think it should be www-data