1

有谁知道是否可以在 PHP 中运行 APT 命令,如果可以,如何?提前致谢。

4

1 回答 1

2

假设您指的是 Debian 的高级打包工具,您可以使用各种功能运行 apt 命令:

  • exec()
  • passthru()
  • shell_exec()
  • system()
  • proc_open()

你可以在这里找到所有这些的文档:http: //php.net/manual/en/ref.exec.php

exec()可能是您想要的,因为它可以让您捕获返回值和输出。

你也可以使用反引号:http ://www.php.net/manual/en/language.operators.execution.php

于 2011-10-11T02:51:43.407 回答