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!
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.
phpfile.php?param=1234)ssh user@otherhost /path/to/php-script argument1 argument2 foo bar. Ensure that the file begins with a sheband (#!/usr/bin/php). The context is the command line, so you don't access arguments via $_GET or $_POST but via $argv (just like in C). Have a look at php.net/manual/en/features.commandline.phpSetup 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.