phpMyAdmin Error During Session Start; Please Check Your PHP

DigitalOcean Referral Badge
Start your VPS now with FREE $100 credit.

We encountered this problem for the first time when trying to login into the phpMyAdmin with the following error log:

Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly…

Well, today we will try to guide you in order to fix problems in phpMyAdmin with the above error logs.

Please note that our server at that time was running under a CentOS 7 distro with VestaCP control panel. So, to solve this problem, just follow the instructions below:

How to Fix It

Here’s a solution to fix phpMyAdmin showing error during session start and asking to checkout PHP.

1. First of all, make sure the “session.save_path” in “php.ini” was set correctly.

session.save_path for VestaCP >> /var/lib/php/session/

Here are the results:

For RHEL/CentOS:

$ nano /etc/php.ini
------------------------------------------

session.save_path = /var/lib/php/session/
------------------------------------------

For Debian/Ubuntu:

------------------------------------------
$ nano /etc/php/php.version/fpm/php.ini
------------------------------------------

For example (Debian/Ubuntu):

------------------------------------------

$ nano /etc/php/8.1/fpm/php.ini
------------------------------------------

session.save_path = /var/lib/php/session/
------------------------------------------

2. Then set directory permissions (CHMOD) to 777

------------------------------------------

$ chmod 777 /var/lib/php/session/
------------------------------------------

3. Restart Apache, Nginx dan VestaCP

$ service vesta restart
$ service httpd restart
$ service nginx restart

PLEASE NOTE: You must restart Apache web server if your VestaCP running with NGINX as reverse proxy in the front of the Apache web server. Or your VestaCP running very well with a Apache web server only without NGINX reverse proxy.

READ:  phpMyAdmin Cannot Log in to the MySQL Server - MariaDB 10.6.7 on HestiaCP Debian 11 "bullseye"

Conclusion

To solve this problem is very easy and does not take a long time. We just need to carefully read each error log, and after that we can fix any related errors or issues.

Leave a Comment