On RED HAT LINUX: Running APACHE
From a PHP script I want to run a Perl script and am trying to do so with the following command:
exec("/usr/bin/perl /home/path/to/perlscript/main.pl", $output, $result);
This seems to fail because the PERL script needs to be run by another user (USER1).
I have tried without success to use SUDO. I have to run the script as (USER1) instead of user (APACHE) because (USER1) has more privileges than APACHE user.
Any idea how I would do this?
sudoanything! You'll need to alter the permission of the file so that the web server can access and run it.