Jump to content

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

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.