Re: Java with apache from perl script?

From: Helgi Briem (HelgiBriem_1_at_hotmail.com)
Date: 10/30/03


Date: Thu, 30 Oct 2003 10:57:49 +0000

On 29 Oct 2003 09:26:16 -0800, i5513@hotmail.com (i5513) wrote:

>Hi, I'm running Apache server with mod_perl active.
>
>I can run my script from command line and all is fine, but when I run
>my script from navigator, it doesn't run fine because my script is:
>
>system "java program_java";

>How can I do Apache to run java programs?
>
CGI is run under a special user with restricted rights and
an empty path variable.

You should always, yes *always* check the results
of system operations and return the error ($! for
internal processes, $? for daughter process).

Give it the full path to java and the program.

my $java = '/full/path/to/java';
my $program_java = '/full/path/to/program_java';
system ($java $program_java) == 0 or die $?;



Relevant Pages