How to run a shell script in PHP?

2019-07-21 22:18发布

问题:

I am trying to trigger the running of a shell script using PHP. Essentially, when a user completes an action on our website programmed in PHP, we want to trigger a shell script which itself calls a Java file. Thanks in advance!

回答1:

See shell_exec(), exec() and other Program execution functions



回答2:

Using shell_exec you can invoke scripts and commands.



回答3:

use the exec() function to execute an external script or function:

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