How to run a shell script in PHP?

2019-07-21 21:23发布

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!

3条回答
走好不送
3楼-- · 2019-07-21 22:21

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

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

查看更多
戒情不戒烟
4楼-- · 2019-07-21 22:26

Using shell_exec you can invoke scripts and commands.

查看更多
登录 后发表回答