<p>Turns out that it was a PHP configuration issue.</p>

<p>Under Windows, the paths in <code>php.ini</code> need to include a drive letter (eg. <code>c:\xampp\php7\</code>). By default they're root-relative (eg. <code>\xampp\php7</code>). When I originally installed XAMPP with PHP 5.x, it adjusted the paths automatically. But when I manually copied the PHP 7 folder into XAMPP to set it up for version switching, I overlooked the path discrepancy.</p>

<p>In this case, it was the inability of PHP 7 to set sessions that was causing the odd behavior.</p>

CC BY-SA 3.0
2018-04-20T09:30:33.480Z
2018-04-20T09:30:33.480Z
Sandwich
<p>I have Craft running locally, the latest 2.x branch. When I change the server to run PHP 7 instead of 5.x, the local Craft frontend still works, but I can't login to the backend. It says "Invalid username or password", even after doing the reset password process.</p>

<p>Trying to prep a site for upgrading to Craft 3, but if I can't even get Craft 2.x running on PHP 7... :-/</p>

CC BY-SA 3.0
2018-04-09T13:12:37.833Z
Any change you are running PHP 7.2?
Gįëł Tėttëłæår
CC BY-SA 3.0
2018-04-09T13:14:42.133Z
I _was_, but saw the incompatibility note in the docs and so switched to 7.1. No difference—not even via password reset.
Sandwich
CC BY-SA 3.0
2018-04-09T13:19:26.317Z
If you have access to the mysql db - enter the following values for the user you are trying to access: -- USERNAME: 'admin' || PASSWORD: '$2a$13$5j8bSRoKQZipjtIg6FXWR.kGRR3UfCL.QeMIt2yTRH1.hCNHLQKtq'; If that doesnt work you will probably have to look at the logs and see what errors are being thrown -- the password phrase to use will be 'password'
Gįëł Tėttëłæår
<php><login>
After switching from PHP 5 to 7 for a local 2.x install, I can't login
# After switching from PHP 5 to 7 for a local 2.x install, I can't login

(Asked by: username_0 on 2018-04-09)

I have Craft running locally, the latest 2.x branch. When I change the server to run PHP 7 instead of 5.x, the local Craft frontend still works, but I can't login to the backend. It says "Invalid username or password", even after doing the reset password process.

Trying to prep a site for upgrading to Craft 3, but if I can't even get Craft 2.x running on PHP 7... :-/

**Tags:** php, login
> **Comments:**
> **username_1**: Any change you are running PHP 7.2?  
> **username_0**: I _was_, but saw the incompatibility note in the docs and so switched to 7.1. No difference—not even via password reset.  
> **username_1**: If you have access to the mysql db - enter the following values for the user you are trying to access: -- USERNAME: 'admin' || PASSWORD: '$2a$13$5j8bSRoKQZipjtIg6FXWR.kGRR3UfCL.QeMIt2yTRH1.hCNHLQKtq'; If that doesnt work you will probably have to look at the logs and see what errors are being thrown -- the password phrase to use will be 'password'  

---

## 1 answers

### Answer by username_0 on 2018-04-20. Score: 1 | Accepted answer

Turns out that it was a PHP configuration issue.

Under Windows, the paths in `php.ini` need to include a drive letter (eg. `c:\xampp\php7\`). By default they're root-relative (eg. `\xampp\php7`). When I originally installed XAMPP with PHP 5.x, it adjusted the paths automatically. But when I manually copied the PHP 7 folder into XAMPP to set it up for version switching, I overlooked the path discrepancy.

In this case, it was the inability of PHP 7 to set sessions that was causing the odd behavior.


---

