Comment
Author: Admin | 2025-04-28
I got the following error when I run a command with phpC:\xampp\htdocs>php'php' is not recognized as an internal or external command,operable program or batch file.I don't get any error when I run the command with php in following path:C:\xampp\php>php //do not got error hereWhy I get this error? 'php' is not recognized as an internal or external command, operable program or batch file. Paolo Forgia6,7468 gold badges50 silver badges59 bronze badges asked Jul 8, 2015 at 11:28 SadikhasanSadikhasan18.6k23 gold badges83 silver badges126 bronze badges 0 Add C:\xampp\php to your PATH environment variable.(My Computer->properties -> Advanced system setting-> Environment Variables->path (click on edit))Then close your command prompt and restart again.Note: It's very important to close your command prompt and restart again otherwise changes will not be reflected. answered Jul 8, 2015 at 11:32 3 You need to Go to My Computer->properties -> Advanced system settingNow click on Environment Variables..Add ;C:\xampp\php in path variable valueNow restart command prompt DONE!Note: Make sure you run CMD via run as administrator Nigel Ren57.1k11 gold badges48 silver badges57 bronze badges answered Jan 12, 2017 at 18:00 Prince PatelPrince Patel3,0601 gold badge24 silver badges29 bronze badges 2 You just need to a add the path of your PHP file. In case you are using wamp or have not installed it on the C drive. answered Sep 1, 2017 at 7:22 Set "C:\xampp\php" in your PATH Environment Variable. Then restart CMD prompt. answered Jul 8, 2015 at 11:37 VikasVikas2773 silver badges10 bronze badges 1 You need to add C:\xampp\php to your PATH Environment Variable, Only after then you would be able to execute php command line from outside php_home. answered Jul 8, 2015 at 11:31 RajaRaja8619 silver badges22 bronze badges For Laragon:First, download your PHP from [https://windows.php.net/download/]then unzip your file -> copy folder -> paste this direction:C:\laragon\bin\php`Your folder`search
Add Comment