- 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.
Solution:
1. Create a file named info.php in your web root, add code:
<?php phpinfo(); ?>
2. Check php info on browser, eg:
example.com/info.php.
Screen of phpinfo show up, then search
“session.save_path”
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:
/var/lib/php/session
and we assume that it would be:
/var/lib/php/session.
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:
mkdir session
apache server:
sudo chown -R www-data:www-data /var/lib/php/session
nginx server:
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
Access to
example.com/adminer.php
and login will be successful.
Good luck! 🙂
If you get any trouble, you can contact us via our email: support@bsscommerce.com or Skype: support.bsscommerce
Not working!
Can you tell more about your situation so that we can help you out quickly?
After this … I am getting permission denied
Hi Roy,
This is user permission error which is not related to this article
Please make sure you are using the right user to access the database. The command only changes the permission of session folder, not user permission.
Also, you can check whether your user permission is correct or not.
Please check all again and let us know if you need any further support.
i tried in nginx , and worked perfectly ..
thangs bro
Thank you my friend!