Ruby is installed here:
.rvm/rubies/ruby-2.2.1/bin
Ruby script:
puts "Hello world"
Php script:
<?php
$cmd = "ruby /home/balint/rubytest.rb";
echo system($cmd);
?>
I can run sudo php /home/name/public_html/phprubytest.php
from CLI but not from the browser.
I reach the server via Putty and use Filezilla to put all my website-related files to the public_html folder.
I logged out the error and it turned out I have a permission error:
ruby: Permission denied -- /home/balint/rubytest.rb (LoadError)
This means as a user running the php script from the browser I have no access to that directory on the server.
Any ideas?