I have installed xampp in my windows OS.completed the configuration settings .But i can't run a simple php script from CMD . Is there anything should i do bfore running the script .
Asked
Active
Viewed 2,898 times
0
-
Possible duplicate of ['' is not recognized as an internal or external command, operable program or batch file](https://stackoverflow.com/questions/48321639/is-not-recognized-as-an-internal-or-external-command-operable-program-or-bat) – lit Aug 30 '18 at 13:29
2 Answers
0
Be sure, that php is added to your path variable, so you can run php -v
in your terminal. You should get the current version of your installed php.
If php was added to your path variable, you can run a php script like php file.php
See http://php.net/manual/en/faq.installation.php#faq.installation.addtopath

Stephan
- 27
- 5
-
i have already done that..still not worlking. and gettting a response like the following: 'php' is not recognized as an internal or external command, operable program or batch file. – mohammed yaser Aug 30 '18 at 08:46
-
Then php is not globally available and is not correct in the PATH variable. In case of xampp it would be c:xampp\php – Stephan Aug 30 '18 at 10:08
0
First, you have to go till that file path in command prompt then use command to execute php script,
php file_name.php

Gajanan Kolpuke
- 155
- 1
- 1
- 14
-
'php' is not recognized as an internal or external command, operable program or batch file. – mohammed yaser Aug 30 '18 at 08:36
-
-
-
Verify php is installed or not on your local machine using php -v command on command promt. If PHP is installed then start `apache` server and then execute PHP script. Also, make sure your script should be inside a `htdocs` folder – Gajanan Kolpuke Aug 30 '18 at 12:53