CL PHP [英] CL PHP
问题描述
大家好,
我正在尝试做一些命令行PHP,我注意到当我输入''php''
并点击时输入,它确实启动PHP。但我如何让它做任何事情?
''man php''说如果没有参数,那么标准输入是
读取和执行。 "但是我无法执行任何操作 - 无论是那个还是我
都没有看到输出。
我试过ctrl-d,ctrl-c和CTRL-Z。他们似乎都没有得到它实际执行的
。任何指针?
此致,
-Josh
Joshua Beall写道:大家好,
我正在尝试做一些命令行PHP,我注意到当我输入''php''
并点击回车,它确实启动了PHP。但是我如何让它做任何事情?
''man php''说如果没有参数,则标准输入被读取并执行。但我无法执行任何操作 - 或者我没有看到输出。
我已经尝试过ctrl-d,ctrl-c和ctrl-z。他们似乎都没有得到它实际执行。有什么指针吗?
php myfile.php
// Aho
Joshua Beall写道:大家好,
我正在尝试做一些命令行PHP,我注意到当我输入''php''
并点击时输入,它确实启动PHP。但是我如何让它做任何事情?
''man php''说如果没有参数,则标准输入被读取并执行。但我无法执行任何操作 - 或者我没有看到输出。
我已经尝试过ctrl-d,ctrl-c和ctrl-z。他们似乎都没有得到它实际执行。任何指针?
应该工作,它对我有用。运行php然后键入你的脚本(记住
<?php?>标签)然后ctrl-d。
另外:php< script.php
或:php script.php
添加-q以阻止标题出现
< blockquote>" Kevin Thorpe" <柯*** @ pricetrak.com>在留言中写道
news:40 ********************** @ news.easynet.co.uk ..
应该有用,它对我有用。运行php然后键入你的脚本(记住
<?php?>标签)然后ctrl-d。
嗯...我必须两次点击ctrl-d。
为什么?
Hi All,
I am trying to do some command line PHP, and I note that when I type ''php''
and hit enter, it does start up PHP. But how do I get it to do anything?
''man php'' says that "If no parameter is present then the standard input is
read and executed." But I cannot get to execute anything - either that or I
am not seeing the output.
I have tried ctrl-d, ctrl-c, and ctrl-z. None of them seem to get it to
actually execute. Any pointers?
Sincerely,
-Josh
Joshua Beall wrote:Hi All,
I am trying to do some command line PHP, and I note that when I type ''php''
and hit enter, it does start up PHP. But how do I get it to do anything?
''man php'' says that "If no parameter is present then the standard input is
read and executed." But I cannot get to execute anything - either that or I
am not seeing the output.
I have tried ctrl-d, ctrl-c, and ctrl-z. None of them seem to get it to
actually execute. Any pointers?
php myfile.php
//Aho
Joshua Beall wrote:Hi All,
I am trying to do some command line PHP, and I note that when I type ''php''
and hit enter, it does start up PHP. But how do I get it to do anything?
''man php'' says that "If no parameter is present then the standard input is
read and executed." But I cannot get to execute anything - either that or I
am not seeing the output.
I have tried ctrl-d, ctrl-c, and ctrl-z. None of them seem to get it to
actually execute. Any pointers?
Should work, it does for me. Run php then type your script (remember the
<?php ?> tags) then ctrl-d.
Alternatively: php < script.php
or: php script.php
add -q to stop the header appearing
"Kevin Thorpe" <ke***@pricetrak.com> wrote in message
news:40**********************@news.easynet.co.uk.. .Should work, it does for me. Run php then type your script (remember the
<?php ?> tags) then ctrl-d.
Hmm... I have to hit ctrl-d twice.
Why?
这篇关于CL PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!