C:xampphtdocs>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:xamppphp>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.Bạn đã xem: Cmd

Add C:xamppphp to your PATH environment variable.(My Computer->properties -> Advanced system setting-> Environment Variables->edit path)

Then close your command prompt and restart again.

Bạn đang xem: How do you solve this error php is not recognized as an internal or external command operable program or batch file?

Note: It"s very important to close your command prompt & restart again otherwise changes will not be reflected.

You need khổng lồ Go to lớn My Computer->properties -> Advanced system setting

Now click on Environment Variables..

Xem thêm: Game Tim Chu, Chơi Game Tìm Chữ Cái Tiếng Anh Word Search Online



Now restart command prompt DONE!

Note: Make sure you run CMD via run as administrator


Is your path correctly configured?

In Windows, you can bởi that as described here:


You need to địa chỉ C:xamppphp lớn your PATH Environment Variable, Only after then you would be able to lớn execute php command line from outside php_home.

I also got the following error when I run a command with PHP, I did the solution lượt thích that:

From the desktop, right-click the Computer icon.Choose Properties from the context menu.Click the Advanced system settings link.Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.In the Edit System Variable window, add C:xamppphp khổng lồ your PATH Environment Variable.

Very important note: restart command prompt

Answered By: Udhav SarvaiyaAnswer #8:



Here what I vị on MY PC I install all software that i usually used in G: partian not C:if my operating system is fall (win 10) , bởi vì not need khổng lồ reinstall them again & lost time , Then How windows work it update PATH automatic if you install any new programe or pice of softwore ,


I must update PATH like these HERE! all my software i usually used

%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;G:HashiCorpVagrantin;G:xamppphp;G:xamppmysqlin;G:Program Files (x86)herokuin;G:Program Files (x86)Gitin;G:Program Files (x86)composer;G:Program Files (x86) odejs;G:Program Files (x86)Sublime Text 3;G:Program Files (x86)Microsoft VS Codein;G:Program Files (x86)cygwin64in

Answered By: Abubakr ElghazawyAnswer #9:

Extra info:

If you are using PhpStorm as IDE, after updating the path variable you need lớn restart PhpStorm so that it takes effect.

Restarting terminal window was not enough for me. (PhpStorm 2020.3.2)

Answered By: Adem Tepe The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 & cc by-sa 4.0 .# More Articles How can I validate regex? How lớn store an array into mysql? Symfony2 Routing - route subdomains CodeIgniter activerecord, retrieve last insert id? Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in …? laravel No supported encrypter found. The cipher và / or key length are invalid PHP cli getting đầu vào from user và then dumping into variable possible? Correct indentation of HTML and PHP using Vim Laravel named route for resource controller PHP get start và end date of a week by weeknumber How to lớn write a stored procedure in phpMyAdmin? How lớn convert a string khổng lồ JSON object in PHP Laravel model with Two Primary Keys update Dynamic PayPal button generation - isn't it very insecure? kiến thiết Patterns: How to create database object/connection only when needed? Category Hierarchy (PHP/MySQL) How khổng lồ use multi Auth in laravel 5.2 What's the difference between array_merge & array + array? Accessing an associative array by integer index in PHP