php-for-windows

  1. setx PHPRC "C:\YourPathto\PHP7\php.ini"
    You should seeĀ SUCCESS: Specified value was saved.
  2. Then restart your computer (really).
  3. Or edit environmental variables through the regular way, then restart:

 

  1. cmd -> env
  2. PATH
  3. C:/YourPathto/PHP7 & C:/YourPathto/PHP7/ext

 

The PHPRC (PHP Runtime Configuration) environment variable is one way to tell PHP where to find the main php.ini file. It can sometimes be used to change the location of the main php.ini file.
Reference: http://php.net/configuration.file

https://webmasters.stackexchange.com/questions/102131/what-does-setenv-phprc-do-and-how-is-it-used