0

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 .

mohammed yaser
  • 2,291
  • 2
  • 12
  • 16
  • 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 Answers2

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