Not_Stepehn_hawking
Not_Stepehn_hawking

Reputation: 33

Can PHP command a third party CLI?

I want to extend the automation of the PacketETH program CLI using PHP It can be done in GUI however this still means a user has to do it

Is it possible to have the packetETH run and a PHP deliver instructions, and then receive results back for manipulation? In a broader sense, is this type of connection possible at all? Thankyou

Upvotes: 2

Views: 43

Answers (1)

Nadir Latif
Nadir Latif

Reputation: 3763

You can access the command line from php by using the Php System Program Execution functions. http://php.net/manual/en/book.exec.php. You can try out the exec function. It lets you execute shell commands.

To run the packeteth program from php you can use a command like the following:

exec("/path/to/packeteth/packETHcli -i lo -m 1 -f packet1.pca");

Upvotes: 1

Related Questions