3

I installed newest versions of MySQL, IIS (on windows 10) and PHPMyAdmin.

But PHPMyAdmin 4.6.4 returns an error:

Failed to generate random CSRF token!

If I use PHPMyAdmin 4.0.4.1 I can connect to my local mysql server.

How can I fix this problem in PHPMyAdmin 4.6.4 (on windows IIS)?

1
  • I had this error too, out from nowhere (I didn't install new software, just updated one game...). So I changed Apache port number, and it helped.
    – ZygD
    Mar 9, 2017 at 22:27

4 Answers 4

7

modify php.ini :

session.save_path = "c:\session"

grant modify c:\session permission to USERS

run command: iisreset

2
  • I have the same phpamdin error question on appserv in windows version. How can I grant the permission to USERS? Can you help me? I reinstall the appserv last time happend, now it happens again. I don't know how come the error...
    – robspin
    May 23, 2018 at 9:22
  • how do I grant modify c:\session permission to USERS? do I run the iisreset command from command prompt? please elaborate, I'm very new to these technical setup stuff..
    – dapidmini
    Nov 12, 2018 at 6:35
3

royhutw is kind of right.

The default session.save_path is C:\Windows\Temp. If you're getting this error IIS probably doesn't have permissions to create a session file there.

Only thing you'll have to do is give "IUSR" modify permissions on this folder and reload your phpMyAdmin page.

2

I will write here, maybe it will be useful to someone. I have a similar problem but with mysql 8 on debian 9 and sometimes I get an error token. This kind of stupid solution works for me: I change the line in php.ini:

session.save_path = "/ var / lib / php / sessions"

For anything, later I run:

sudo service apache2 restart

And once again I change the exchange line above to the correct one and reset again and I can log in to phpmyadmin ...

0

In the web browser, manually delete the entry "phpMyAdmin", it will be solved easily. For mine it worked!

Not the answer you're looking for? Browse other questions tagged or ask your own question.