Page 1 of 1

fopen doesn't execute anymore

Posted: Wed Nov 26, 2008 11:14 am
by TheKurgan
We recently switched to a newer version of apache and there has been some problems mainly with variables not getting set. I had to start using $_POST[''] and that fixed most of the issues however I seem to be having a problem with one php script that is using fopen to execute a perl script and capture the return. It was previously working on the old server, but now instead of actually executing the script, it just displays the script. Here is what it looks like:

$fp = fopen( "http://middleware.company.com/appsptchk ... MANUAL=YES", "r");
while ( $results = fread($fp, 1024) )
{
$newresults .= $results;
}
fclose($fp);
if ( stristr($newresults, "Up and Running") )
{
echo ("<FONT COLOR=\"518A3C\" SIZE=\"+2\"><B>SUCCESS ON ".$THISHOST." for ".$BILLSYS."</B></FONT><BR>\n");
}
else
{
echo ("<FONT COLOR=\"DD2222\" SIZE=\"+2\"><B>FAILURE ON ".$THISHOST." for ".$BILLSYS."</B></FONT><BR>\n");
}
echo ("The response from the web server is<BR>\n");
echo ("<TEXTAREA ROWS=\"15\" COLS=\"80\">".$newresults."</TEXTAREA>\n");

Any idea why it's now displaying the script's contents and not actually executing the cgi script anymore ?

Re: fopen doesn't execute anymore

Posted: Wed Nov 26, 2008 1:02 pm
by JAB Creations
CHMOD! You'll likely have to change the permissions of the directories involved.