Jump to content

Needing help, hot to execute a perl script in PHP


CG_dude

Recommended Posts

Thanks for your consideration on this topic. 

I'm running PHP 4.2.3, I'm planning to upgrade, but not there yet. I'm running on a unix server.

I'm trying to execute a perl script from my php page that is on the same server as my php and have it write the output to a txt file.  I can see that hit hits the text file, but it seems that it's not executing the perl file since nothing is being written to the text file. I can execute the perl script from the command line and it works.  Here is my code.  I will be here most of the night and early morning trying to solve this.  Thanks for any help.

 

<?php
$myfile = "/users/apache/hpws/apache/htdocs/prod_report/myresults.txt";
?>
</html>
<html>
<body>
<!-- This table has all the job info -->
<table border=1 cellspacing=2 bordercolor="#303065" align=justify WIDTH=89% bgcolor="white">
<tr bgcolor="#6699FF"><th>Line#</th>  <th>Key Milestones</th> 	<th>End Time in PST</th> </tr>

<td>18</td>
<td>Transaction Handoff </td>    
<td>
<?php
$fh = fopen($myfile, 'w+');
$stringdata = shell_exec("/users/apache/hpws/apache/cgi-bin/perl_script.pl");
fwrite($fh, $stringdata);
fclose($fh)
?>
</td>  
</tr>
</table>
</body>
</html> 

:code_tags:

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.