user1974855
user1974855

Reputation: 11

Running SSH Command from Raspberry PI in PHP

when executing this command in linux wheezy throug SSH, it works fine;

pi@raspberry /usr/bin $ ./send -u 2 -i 0546845 -f

But how can i put this in for example test.php page (from var/www/test.php) so i can run this in a webpage?

Tried several things, but need some help getting into the right direction.

Many thanks.

Upvotes: 0

Views: 1267

Answers (2)

Danel October
Danel October

Reputation: 15

I don't know how to reply to an "answer".. hehe..

I think you can simply do this:

system('/usr/bin $ ./send -u 2 -i 0546845 -f');

add that to your php script.

Upvotes: 0

Quentin
Quentin

Reputation: 943518

Use the system function.

string system ( string $command [, int &$return_var ] )

Upvotes: 2

Related Questions