0

When I run php -v I get 'php' is not recognized as an internal or external command, operable program or batch file.. Problem is that I set an environment variable, so im not sure what else could be wrong. I have WAMP installed and have three php versions on it 8.0.26, 8.1.13 and 8.2.0.

Environment variable path:

C:\wamp64\bin\php\php8.0.26

This is where I added the variable:

https://gyazo.com/7453dd9bb6dd4b44927c8a33916fd0dc

Result of echo %Path%

C:\Users\[MyName]>echo %Path%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\nodejs\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\dotnet\;C:\ProgramData\ComposerSetup\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\wamp64\bin\php\php8.0.26;C:\Users\[MyName]\AppData\Local\Microsoft\WindowsApps;C:\Users\[MyName]\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\[MyName]\.dotnet\tools;C:\Program Files\Azure Data Studio\bin;C:\Users\[MyName]\AppData\Roaming\npm;C:\Program Files\heroku\bin;C:\Users\[MyName]\AppData\Roaming\Composer\vendor\bin;C:\Users\[MyName]\AppData\Local\GitHubDesktop\bin;

result of dir C:\wamp64\bin\php\php8.0.26

C:\Users\[MyName]>dir C:\wamp64\bin\php\php8.0.26
The system cannot find the path specified.
  • You set 'an environment variable'. Did you set the `PATH` ebvironment variable? – Tangentially Perpendicular Jan 01 '23 at 21:32
  • Did you close and re-open your console window after setting the path? Variables are initialized when the process starts. – Greg Schmidt Jan 01 '23 at 22:51
  • @TangentiallyPerpendicular I added a screenshot showing where I set it. – BlindSocket Jan 01 '23 at 23:04
  • @GregSchmidt yes, and I restarted my pc multiple times just in case. – BlindSocket Jan 01 '23 at 23:05
  • Can you show us the results of running `echo %Path%` and `dir C:\wamp64\bin\php\php8.0.26`? – Greg Schmidt Jan 02 '23 at 02:50
  • https://stackoverflow.com/a/31291404/19921214 < this a similar question to yours. The answer explains it just as the above comments. Check if it helps :) – tabby.sl Jan 02 '23 at 04:11
  • @tabby.sl I had already followed that answer + the comment with the wamp version. But it didn't work, that's what the screenshot shows. – BlindSocket Jan 02 '23 at 09:33
  • "The system cannot find the path specified." So the folder you've added to your path doesn't actually exist. No surprise then that it's not able to find the `php` executable in it. – Greg Schmidt Jan 02 '23 at 16:07
  • @GregSchmidt nvm the actual path is `C:\wamp\bin\php\php8.0.26` instead of `C:\wamp64\bin\php\php8.0.26`. Although I for some reason installed wamp 32bit instead of 64bit so I'm going to reinstall 64bit. – BlindSocket Jan 06 '23 at 13:41

0 Answers0