如何从 powershell-commandline 运行 php 脚本? [英] How can I to run php script from powershell-commandline?
问题描述
如何设置我的 powershell 以像这样的命令调用一样运行 php 脚本
How can i setup my powershell to run php scripts in like a commandcall like this
php test.php
我可以在工作中通过 putty 连接到的服务器上执行此操作,但是如果我能够直接从我自己的脚本执行这些脚本而无需运行某些服务器,那就太好了.我也知道 Xaml,我不喜欢它,因为它需要你刷新一些浏览器.
I'm able to do this on a server at work which I connect to by putty, but would be nice if I was able to execute those scripts directly from my own without having some server running. I also know about Xaml, which I don't like since its require you to refresh some browser.
推荐答案
因为你说的是 powershell,所以我假设是 Windows.你可以在windows上安装php,但这也意味着安装apache或启用IIS.
I'm assuming windows since you said powershell. You can just install php on windows but that means also installing apache or enabling IIS.
或者显然有一个内置网络服务器用于命令-线功能,可以最大限度地减少配置这些东西所涉及的麻烦.
Or there's apparently a built-in webserver for command-line functionality that might minimize the amount of headache involved in configuring that stuff.
这也可能有助于您前进:http://php.net/手册/en/install.windows.legacy.index.php#install.windows.legacy.commandline
This might help get you going also: http://php.net/manual/en/install.windows.legacy.index.php#install.windows.legacy.commandline
这篇关于如何从 powershell-commandline 运行 php 脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!