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:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.