run the PHP buit-in web server from file cmd

php windows server

61 观看

1回复

10 作者的声誉

I often use the PHP built-in server from CMD (windows) with: php -S 127.0.0.2:8000

But, I want to create a CMD File, which I just double click to run the server. I tried with : exec, chell_exec, system but it doesn't work.

作者: Younes 的来源 发布者: 2017 年 12 月 27 日

回应 1


1

673 作者的声誉

决定

What you need is a batch programm. Take a look on these sources:

[1] [2]

How to do it:

  • create a file e.g. yourbatch.bat
  • add following line: php -S 127.0.0.2:8000 or start php -S 127.0.0.2:8000
  • save
  • double click your file
作者: 1stthomas 发布者: 2017 年 12 月 27 日
32x32