Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php shell_exec()如何选择要使用的shell?_Php - Fatal编程技术网

Php shell_exec()如何选择要使用的shell?

Php shell_exec()如何选择要使用的shell?,php,Php,这个问题在另一个线程中出现了。我想我会问的 如果它使用popen(),则在Linux上使用/bin/sh。popen()的手册页显示: command参数是指向包含shell命令行的以null结尾的字符串的指针。使用-c标志将该命令传递给/bin/sh;解释(如有)由壳牌公司执行 /bin/sh是POSIX保证可用的唯一shell。我假设is使用Csystem()函数,所以它使用任何使用的函数。这将依赖于操作系统(在Unix上可能是/bin/sh,在Windows上可能是cmd.exe)。@Ba

这个问题在另一个线程中出现了。我想我会问的

如果它使用
popen()
,则在Linux上使用
/bin/sh
popen()
的手册页显示:

command参数是指向包含shell命令行的以null结尾的字符串的指针。使用-c标志将该命令传递给/bin/sh;解释(如有)由壳牌公司执行


/bin/sh
是POSIX保证可用的唯一shell。

我假设is使用C
system()
函数,所以它使用任何使用的函数。这将依赖于操作系统(在Unix上可能是/bin/sh,在Windows上可能是cmd.exe)。@Barmar:将此作为答案发布。它至少在linux上使用popen()。为什么是/bin/sh?@zerkms,我认为Barmar是对的,/bin/sh来自popen(),但感谢您在正确的道路上引导popenOh的使用,我刚刚阅读了该手册页,但没有发现
/bin/sh
部分+1@Barmar:“如果它使用popen()”--您可以在php源代码中放置指向确切位置的链接