Spencer
Spencer

Reputation: 22370

How to run a shell script in PHP?

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!

Upvotes: 2

Views: 1011

Answers (3)

david
david

Reputation: 33537

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

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

Upvotes: 0

zengr
zengr

Reputation: 38899

Using shell_exec you can invoke scripts and commands.

Upvotes: 0

NullUserException
NullUserException

Reputation: 85458

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

Upvotes: 3

Related Questions