From: Chad Perrin Date: 2010-12-07T04:46:28+09:00 Subject: Re: ruby on server side --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 07, 2010 at 03:10:37AM +0900, Rajesh Huria wrote: >=20 > system('ruby -v'); // This is giving proper output i.e ruby version > system('ruby myprogram.rb'); // no action >=20 > myprogram.rb is executing fine over shell but when i try to execute via > upload.php, nothing is happening. Any idea why ruby not working on > server side when accessing via upload.php ? I suspect you are having some path issues. The PHP script probably isn't "aware" of how to find the myprogram.rb script. Try using the full path to the Ruby script there. Then . . . assuming that works, you might want to look into how you can make path handling a little more robust and flexible. First step, of course, is just making sure that the Ruby program will work in this context, and you should be able to do it with something like: system('ruby /absolute/path/to/myprogram.rb'); >=20 > do i need to do anything on apache side? It's probably related to the execution context of your PHP script (what it "thinks" is its current working directory) and the location of your Ruby program. >=20 > i dont have any ruby handler installed on apache? is this could be the > reason? That should not affect the execution of a Ruby script via PHP's system() function, as far as I'm aware. --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkz9O94ACgkQ9mn/Pj01uKXCOgCg00LDcL3sk96SX8HLJyaie4p0 7mMAoIrtHqQVaVvkLOdnY/TFHFkw6jlv =bIds -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--