how can I see the hidden variables in the system environment variables

Viewed 36

I want to change the version of php, so I went to the system environment variables > PATH but I didn't see any php path. but php is working fine when I run > php -v I get

PHP 8.0.12 (cli) (built: Oct 23 2019 09:24:14) ...

I noticed that there's a variable stored already for php, but I can't see it in the system environment variables, I run > php -i:

.
.
.
$_SERVER['Path'] => 
  C:\Users\*****\AppData\Local\Microsoft\WindowsApps;
  C:\Users\*****\AppData\Roaming\npm;
  C:\Users\*****\AppData\Local\GitHubDesktop\bin;
  C:\Users\*****\AppData\Local\Programs\Microsoft VS Code\bin;
  C:\Users\*****\AppData\Roaming\Composer\vendor\bin
  C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
  C:\WINDOWS\system32;C:\WINDOWS;
  C:\WINDOWS\System32\Wbem;
  C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
  C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;
> C:\wamp64\bin\php\php8.0.13;
  C:\composer;
  C:\Program Files\Git\cmd;
> C:\xampp\php;

.
.
.

what I see in PATH

I simply want to edit the php's paths 'xampp' and 'wamp' so I can change the version of php in anyway
thanks

1 Answers

simply I had to delete them in powershell then add the to the system environment variables:

$removePath = 'C:\xampp\php'

then run this

$regexRemovePath = [regex]::Escape($removePath)
$arrPath = $env:Path -split ';' | Where-Object {$_ -notMatch 
"^$regexRemovePath\\?"}
$env:Path = $arrPath -join ';'

resource

Related