Jump to content

Apache config, php.ini, permissions error??


matleeds

Recommended Posts

Hi,

 

I'm using Windows Vista, I have Apache HTTP server 2.2 running and am using PHP 5.2.17.

 

I’m having a problem remotely running a php script on the web server. I run this script locally  below…

 

<?php
$file = fopen ("http://localhost/Epointment/testphp.php", "r");
if (!$file) {
    echo "<p>Unable to open remote file.\n";
    exit;
}
while (!feof ($file)) {
    $line = fgets ($file, 1024);
    /* This only works if the title and its tags are on one line */
    if (preg_match ("@\<title\>(.*)\</title\>@i", $line, $out)) {
        $title = $out[1];
	echo "/n".$title."/n";
        break;
    }
}
fclose($file);
?>

And after about 30 seconds get back…

 

PHP Warning: file_get_contents(http://localhost/Epointment/testphp.php): failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host failed to respond.

 

As this will be used in the real world I can’t really use a Path instead of the URL and I have tested it on a ‘real’ web server (one that’s not on my pc and not localhost) and it works and I have also run the testphp.php script ok directly on the webserver.

 

Thanks for any help…

 

Link to comment
https://forums.phpfreaks.com/topic/245766-apache-config-phpini-permissions-error/
Share on other sites

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.