user966197
user966197

Reputation: 195

Running APT Commands in PHP

Does anyone know if running APT commands in PHP is possible, and if so, how? Thanks in advance.

Upvotes: 1

Views: 118

Answers (1)

Cal
Cal

Reputation: 7157

Assuming you mean Debian's Advanced Packaging Tool, you can run apt commands using a variety of functions:

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

you can find the documentation for all of them here: http://php.net/manual/en/ref.exec.php

exec() is probably the one you want, since it lets you capture the return value and the output.

you could also use backticks: http://www.php.net/manual/en/language.operators.execution.php

Upvotes: 2

Related Questions