Run .php file in Windows Command Prompt (cmd)

后端 未结 4 418
灰色年华
灰色年华 2020-12-08 11:04

I want to run a .php file in windows cmd. I followed this (suggestion) php is not recognized as an internal command (in Windows)

But it did not work.

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 12:05

    It seems your question is very much older. But I just saw it. I searched(not in google) and found My Answer.

    So I am writing its solution so that others may get help from it.

    Here is my solution.

    Unlike the other answers, you don't need to setup environments.

    all you need is just to write php index.php if index.php is your file name.

    then you will see that, the file compiled and showing it's desired output.

提交回复
热议问题