0

I have a problem, is this possible to run the bash command from PHP level?

TarasB
2,4381 gold badge25 silver badges32 bronze badges
asked Oct 22, 2014 at 8:12
0

2 Answers 2

1

A lot of functions exist, allowing you to have the precision level you want.

The only way to choose is to read the doc for these functions.

I post you some links to read :

http://php.net/manual/en/function.proc-open.php

http://php.net/manual/en/function.popen.php

http://php.net/manual/en/function.shell-exec.php

http://php.net/manual/en/function.exec.php

http://php.net/manual/en/function.passthru.php

biziclop
14.6k3 gold badges52 silver badges66 bronze badges
answered Oct 22, 2014 at 8:30
Sign up to request clarification or add additional context in comments.

Comments

0

If you need to execute a command from php you can do it using the native function system() or exec(). For example if you would like execute bash command uname -a, with system call:

$output = system("uname -a", $status);

second argument is optionally; if it's present, return the status of the executed command. For more details i suggest you to take a look to follow php man pages

https://www.php.net/manual/en/function.system.php

https://www.php.net/manual/en/function.exec.php

answered Oct 22, 2014 at 8:24

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.