C:xampphtdocs>php"php" is not recognized as an internal or external comm&,operable program or batch tệp tin.I don"t get any error when I run the comm& with php in following path:

C:xamppphp>php //vị not got error hereWhy I get this error?

"php" is not recognized as an internal or external command, operable program or batch tệp tin.

Bạn đang xem: Cmd


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

Then close your command prompt & restart again.

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


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

Now cliông xã on Environment Variables..

*

Add ;C:xamppphp in path variable value

*

Now restart comm& prompt DONE!

Note: Make sure you run CMD via run as administrator


You just need to lớn a add the path of your PHPhường tệp tin. In case you are using wamp or have sầu not installed it on the C drive sầu.

Xem thêm: Học Ngay 2 Cách Vẽ Hoa Hướng Dẫn Vẽ Hoa Hướng Dương Đơn Giản Mà Đẹp

*


Is your path correctly configured?

In Windows, you can vì that as described here:

http://www.computerhope.com/issues/ch000549.htm


You need khổng lồ add C:xamppphp khổng lồ your PATH Environment Variable, Only after then you would be able to lớn exedễ thương php commvà line from outside php_home page.


I also got the following error when I run a comm& with PHPhường, I did the solution lượt thích that:

From the desktop, right-clichồng the Computer inhỏ.Choose Properties from the context menu.Clichồng the Advanced system settings link.Cliông xã Environment Variables. In the section System Variables, find the PATH environment variable and select it. Clichồng Edit. If the PATH environment variable does not exist, cliông chồng New.In the Edit System Variable window, Add C:xamppphp khổng lồ your PATH Environment Variable.

Very important note: restart comm& prompt


Answered By: Udhav Sarvaiya
Answer #8:

*
*

Here what I DO on MY PC I install all software that i usually used in G: partian not C:if my operating system is fall (win 10) , Do not need to lớn reinstall them again & lost time , Then How windows work it update PATH automatic if you install any new programe or pice of softwore ,

SO

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 Elghazawy
Answer #9:

Extra info:

If you are using PhpStorm as IDE, after updating the path variable you need khổng lồ restart PhpStorm so that it takes effect.

Restarting terminal window was not enough for me. (PhpStorm 20trăng tròn.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 to store an array into lớn mysql?
Symfony2 Routing - route subdomains
CodeIgniter activerecord, retrieve sầu last insert id?
Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in …?
laravel No supported encrypter found. The cipher and / or key length are invalid
PHP. cli getting đầu vào from user và then dumping inkhổng lồ variable possible?
Correct indentation of HTML & PHPhường using Vyên
Laravel named route for resource controller
PHP. get start & kết thúc date of a week by weeknumber
How to write a stored procedure in phpMyAdmin?
How to convert a string khổng lồ JSON object in PHPhường
Laravel Model with Two Primary Keys update
Dynamic PayPal button generation - isn't it very insecure?
Design Patterns: How to create database object/connection only when needed?
Category Hierarchy (PHP/MySQL)
How lớn use multi Auth in laravel 5.2
What's the difference between array_merge và array + array?
Accessing an associative array by integer index in PHPhường