Jump to content

How do you execute a perl script from PHP


CG_dude

Recommended Posts

Hello,

I'm somewhat new to PHP, trying to execute a perl script from the PHP page.  The perl script is on the same server and my version is PHP 4.2.3

I may have more than one issue, as the perl script opens a sybase connection and runs a sql query and in the script it outputs what I need to post to the PHP page.  The issue is the script asks for my username and password for access to run the query.  From the command line I can run a bl_wrapper.sh with the perl script and it wroks great.  The shell script has this in it "bl -g $1 /users/apache/hpws/apache/cgi-bin username password".  In the perl script there is a variable that is $endtime that spits out the end time.  I've tried many things including exec, passthough, etc...  Can anyone help ?  Here is what I have so far ..

 

<?php

$command = "/users/apache/hpws/apache/htdocs/prod_report/bl_wrapper.sh pa_box_settle.pl";

$etime = ($command);

$return = ($etime);

exec($command,$etime,$return);

print($etime);

 

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.