Php is not recognized as an internal or external command operable program or batch file. in cmd

I am getting this error when I run the command in PHP:

C:\xampp\htdocs>php 'php' is not recognized as an internal or external command, operable program or batch file.

When I run the command in this path, it doesn't give an error.

C:\xampp\php>php //do not got error here

Why am I getting this error? and how can I solve this?

If you have already installed Wampserver or Xamp, but you still get this error “PHP is not recognized as an internal or external command” in Command prompt or windows power shell, composer, etc.

Try below method to solve this error.

Just copy your php location on your Wamp or Xamp.

That may be:

On Xamp: C:\xampp\php

On Wamp: C:\wamp\bin\php\php5.5.12 (version may change)

Php is not recognized as an internal or external command operable program or batch file. in cmd

On your Windows Start Menu, ‘search for Enviorment variables’

Php is not recognized as an internal or external command operable program or batch file. in cmd

  • On Environment Variables, Select Path
  • Edit Path

Php is not recognized as an internal or external command operable program or batch file. in cmd

On New button, add your path to php.

Php is not recognized as an internal or external command operable program or batch file. in cmd

OK.

I added php to the PATH environment var. Showing here my last three entries in the path input:

C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseGit\bin;C:\xampp\php\

Somehow when I run php -v in the cmd I still get the not recognized as an internal or external command error.

Any ideas on how should I fix this?

Php is not recognized as an internal or external command operable program or batch file. in cmd

asked Mar 12, 2013 at 22:26

13

It works now. The problem was that extra slash at the end (in the PATH environment variable).

I tried with:

C:\Program Files\TortoiseGit\bin;C:\xampp\php\

but it didn't work, then with

C:\Program Files\TortoiseGit\bin; C:\xampp\php

but it didn't work also (notice the extra space before 'C:..').

Eventually,

C:\Program Files\TortoiseGit\bin;C:\xampp\php

did the trick.

answered Mar 13, 2013 at 22:46

ZubzobZubzob

1911 gold badge1 silver badge6 bronze badges

2

Not the answer you're looking for? Browse other questions tagged php command-line xampp or ask your own question.

Today, We want to share with you PHP is not recognized as an internal or external command in command prompt(windows 7/8) xampp.In this post we will show you recognized as an internal or external command phpstorm, hear for recognized as an internalexternal command, operable program or batch file we will give you demo and example for implement.In this post, we will learn about php not recognized command wamp with an example.

PHP is not recognized as an internal or external command in command prompt(windows 7/8) xampp

  • PHP is not recognized as an internal or external command in command prompt(windows 7/8) xampp
    • Step 1: go to Advanced system setting
    • Step 2: Update the path variable value
    • Step 3: restart CMD
    • Read :
    • Summary
    • Related posts:

There are the Following The simple About recognized as an internal orexternal command sublime Full Information With Example and source code.

As I will cover this Post with live Working example to develop recognized as an internal/external command visual studio code, so the ‘php.exe’ is not recognized as an internalor external command, operable program or batch file is used for this example is following below.

PHP is a very spreading for website to general-purpose (server side)scripting language that is especially suited to web development application/projects.It’s a very Fast, flexible and pragmatic PHP Programming Languages,which is used to design the dynamic web applications with MySQL database. Here Learn Completely Free & step by step PHP Tutorial.PHP Tutorial For Beginners Step By Step With Example,Here we would like to show the very basics of PHP in a short code and example with simple Web tutorial.

Keywords : php’ is not recognized as an internal or externalcommand visual studio code, php isnot recognized as an internalexternal command sublime, php not recognized command wamp, php isnot recognized as an internalor externalcommand phpstorm, php.exe isnot recognized as an internalexternal command yii,
symfony is not recognized as an internalor external command, phpstorm is not recognized as an internalexternal command, ‘phpunit’ is not recognized as an internalor external command, operable program or batch file.

Need to add C:\xampp\php to your PATH environment variable.
Then close your command prompt and restart again.
It is very important because if you do not restart your command prompt then changes will not be reflected.

Step 1: go to Advanced system setting

Go to My Computer->properties -> Advanced system setting

adn then you can click on Environment Variables.Like below Imgage.

Php is not recognized as an internal or external command operable program or batch file. in cmd
PHP is not recognized as an internalor external command

Step 2: Update the path variable value

‘php is not recognized as an internal or external command’ even though path is set

and then simple you Add ;C:\xampp\php in path variable value below Screenshot.

Php is not recognized as an internal or external command operable program or batch file. in cmd
PHP is not recognized as an internalor external command

Step 3: restart CMD

and last step to you can simple your system restart command prompt DONE!

Imp Note: Make 100% sure ssystem you run CMD(Terminal) via run as administrator.

Web Programming Tutorials Example with Demo

Read :

  • Jobs
  • Make Money
  • Programming

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about php.exe is not recognized as an internal or external command yii.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I’m a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

How do you fix PHP is not recognized as an internal or external?

Follow these steps:.
Go to System Properties..
Go to Advanced..
Go to Environmental Variables..
Edit the Path environment variable..
Add the installation path of xammp/wamp like in my case the path is E:\xammp\php..
Click on Ok..
Restart command prompt (cmd).
Check the version of PHP by running php --version ..

Why PHP is not recognized as an internal or external command operable program or batch file?

This is because of the environment path for the ph p.exe file is not exist. To make it work you need to set the environment path into the system setting.

How do you fix the term PHP is not recognized as the name of a cmdlet?

1 Answer.
Right click on My Computer , select Properties..
Select Advanced System Settings..
In the System Properties window click the Environment Variables button ..
Select System Variables -> PATH and click Edit..
Enter the folder where your PHP.exe is located..

How do I know if PHP is installed on Windows?

1. Type the following command, replacing [location] with the path to your PHP installation. 2. Typing php -v now shows the PHP version installed on your Windows system.