Miakatt
Miakatt

Reputation: 51

PHP to send a 'command line' command to a PC on the same network

I'm very new to PHP. I want to be able to write some code that uses exec() to send a command to a PC on the same network. Something like: exec("ip_address","port","command arg1 arg2 arg2")

Does such a function exist? I've been searching but only get the usual exec() results.

Upvotes: 0

Views: 163

Answers (1)

moreirapontocom
moreirapontocom

Reputation: 458

Another approach is use sockets. Both machines 1 and 2 are listening for new socket messages from a server that is located in same network. When machine 1 send a command to socket, the server will notify each machine connected into it and these machines will handle the command.

Using this you can choose what machines should execute the command, you can delay the command execution, filter commands etc.

Upvotes: 1

Related Questions