PHP CLI PHP Path

Two in one day! These posts are mainly helping me remember things down the road. Like the Local host one. I have re-visited that post so freakin’ often. 

Anywho, onto the topic on hand. I have several different XAMPP versions installed. Why? Well I have different sites that are on different versions. I haven’t taken the time to upgrade them to PHP 7 and Laravel 5.2 just needs 5.6–not 7. So I have several versions of XAMPP. XAMPP isn’t the problem. It’s git bash that’s the problem. It looks at the file for the first PHP version I installed. I needed it to look at the latest PHP.exe I just installed. So how to do this? After googling for about 2 hours, I came to this solution: change your PATH in the System Environment Variables. Here’s how:

  • Press Win+R > This will open up the Run window. 
  • Put in this: rundll32.exe sysdm.cpl,EditEnvironmentVariables
  • There should be a PATH variable on the window that appears. Edit it.
  • Change the PHP path if there or add in the path.
  • Restart git bash

Viola!