从文件cmd运行PHP内置Web服务器

问题描述 投票:1回答:1

我经常使用CMD(windows)中的PHP内置服务器:php -S 127.0.0.2:8000

但是,我想创建一个CMD文件,我只需双击即可运行服务器。我试过:execchell_exec,系统,但它不起作用。

php windows server
1个回答
1
投票

你需要的是一个批处理程序。看看这些来源:

[1] [2]

怎么做:

  • 创建文件,例如yourbatch.bat
  • 添加以下行:php -S 127.0.0.2:8000start php -S 127.0.0.2:8000
  • 保存
  • 双击您的文件
© www.soinside.com 2019 - 2024. All rights reserved.