Alex
Alex

Reputation: 5685

Call PHP script from bash from different machine

I need to call a PHP script on machine1 from a .sh script on machine2. How can I do this?
Basically I need to pass a parameter to the respective PHP script and make it run using it.

Thanks!

Upvotes: 0

Views: 256

Answers (2)

Florian
Florian

Reputation: 3171

You can use ssh:

ssh user@otherhost /path/to/php-script

if you want to do this in a script, you have to enable public key authentiction.

Upvotes: 2

cgp
cgp

Reputation: 41381

Setup Apache and use curl, or use SSH as the other answer suggested. The security aspects of setting up Apache seems simpler at first, but this may not be true.

Upvotes: 2

Related Questions