Centos and nginx – phpMyAdmin not working

With my default setup of Centos 6.5 64 bit and nginx 1.4.x, I got a strange error when setting up phpMyAdmin. It turns out that it was just a directory permission issue and that the default setup expects user it be apache instead of nginx.

What I got is a UI error saying something is wrong with sessions with red colors all over the place.

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.

Behind it is a clearer error as seen in error log:

PHP Fatal error: Class 'PMA_Message' not found in ...

The issue is that the permission set on /var/lib/php/session is owned by root user and apache group. Just change the group to nginx to solve the issue.

sudo chgrp nginx -R /var/lib/php/session

That’s it!

This entry was posted in Linux and tagged , , , . Bookmark the permalink.

Related Posts

3 Responses to Centos and nginx – phpMyAdmin not working

  1. Till says:

    This is correct – thank you very much!
    I think defaults like this a very sad…

  2. Mimosa says:

    This is really helpful. Thanks so much. I have been spending two days for finding the solution and it works like a charm.

  3. gino8080 says:

    You are the man!!

    great thank you!!

Leave a Reply

Your email address will not be published. Required fields are marked *