windows 使PHP命令行逐页显示phpinfo?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5043174/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:12:58  来源:igfitidea点击:

Make PHP command line display phpinfo page by page?

windowsunixphpphpinfo

提问by gawpertron

When I use the PHP CLI to get the phpinfo all I end up with is the last half. Here is the command:

当我使用 PHP CLI 获取 phpinfo 时,我最终得到的只是后半部分。这是命令:

> php -i

> php -i

I'm not sure what it would be call? But is there a way of controlling the output so that a portion is displayed a piece at a time with the press of a key? Both on Windows and Linux

我不确定它会叫什么?但是有没有办法控制输出,以便通过按一个键一次显示一个部分?在 Windows 和 Linux 上

回答by Marc B

php -i | more

should work on both Linux and Unix. On Linux, though, moreis simply an alias for the equivalent less

应该适用于 Linux 和 Unix。然而,在 Linux 上,more它只是等价物的别名less

回答by Cole

On Linux you could do from the shell

在 Linux 上,您可以从 shell 执行

php -r "phpinfo();" | less