I need to execute a php script on the deployment server from capistrano 2 deploy script and need to get the output in a variable. I am trying following command which is used to execute shell in ruby
result =%x[php -q #{myDeployPath}/myfile.php]
I am getting "Could not open file" error , this is because it is trying run this php on my local server from where I am deploying on the required server.I am able to execute normal "run" command on the deployment server but have no idea getting output in a variable "result".
I am able to execute this php on serevr by following command but not able to capture the output in the script back.
run "php -q #{myDeployPath}/myfile.php"
Please help.. Thanks!!