- As a programmer in general and a Magento developer in particular, you will often have to access to the database to check, configure or just to test one feature.
There are many ways to access to the database and 1 tool I use frequently is adminer.php.
All activities with adminer are pretty easy, what we need is an extremely basic, compact interface.
It all seems good to adminer, I have nothing to complain.
But suddenly one day, it (referring adminer on my server) suddenly … could not log in, even though I filled user and password properly.
or one similar type of error:
Reasons: PHP cannot save session.
1. Create a file named info.php in your web root, add code:
<?php phpinfo(); ?>
2. Check php info on browser, eg:
Screen of phpinfo show up, then search
Here is the result:
3. As you can see, session files are stored in C:\xampp\tmp, because I am using localhost, each server will be different. Normally it would be:
and we assume that it would be:
4. Use terminal or putty to access to ssh server, cd to /var/lib/php/, we will have 2 possible cases:
- Folder session does not exist.
- Session directory exists and was set to wrong permission
In the first case, we need to create and set the correct permission:
sudo chown -R www-data:www-data /var/lib/php/session
chown -R nginx:nginx /var/lib/php/session
Or if you use another user to run server:
php -i | grep USER //check php user
groups username //check group
chown -R username:groupname /var/lib/php/session
Finally, we obtain write and read authorization on folder:
chmod -R 700 /var/lib/php/session
and login will be successful.
Good luck! 🙂