fopen doesn't execute anymore

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TheKurgan
Forum Newbie
Posts: 1
Joined: Wed Nov 26, 2008 11:08 am

fopen doesn't execute anymore

Post 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 ?
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: fopen doesn't execute anymore

Post by JAB Creations »

CHMOD! You'll likely have to change the permissions of the directories involved.
Post Reply