|
Author |
Message |
php4ever
Junior WebHelper


Joined: 10 Oct 2002
Posts: 49
|
Posted:
Mon Jan 20, 2003 11:16 pm (22 years, 3 months ago) |
  |
Hi, I have a site where according to phpinfo(), fopen_url is enabled at both the local and master levels. However, fopen isn't working anywhere on my site today and I haven't touched the code. Here's a test page that I created:
<?php
$h = fopen("http://www.php.net","r");
if ($h)
{ print "The file exists!"; }
else
{ print "The file does not exist"; }
?>
and when I ran it the results were like this:
Warning: php_network_getaddresses: getaddrinfo failed: Name or service not known in /web/sites/112/slevy/www.preservestaffnow.org/fopen_test.php on line 3
Warning: fopen("http://www.php.net", "r") - Bad file descriptor in /web/sites/112/slevy/www.preservestaffnow.org/fopen_test.php on line 3
The file does not exist
So, does anybody have any ideas as to why I would get these error messages if fopen_url is enabled? Or, can the phpinfo() be providing results that no longer reflect the current configuration?
Any thoughts you might have to share I'd greatly appreciate.
-- php4ever
p.s. fsockopen is also not working at my site. |
|
|
    |
 |
adam
Forum Moderator & Developer

Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Fri Jan 24, 2003 6:27 pm (22 years, 3 months ago) |
  |
I don't think that php follows http redirects...so you may have to type the full url, i.e. $h = fopen('http://www.php.net/index.php');
not sure though. |
________________________________ It's turtles all the way down... |
|
     |
 |
Daniel
Team Member


Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Fri Jan 24, 2003 6:36 pm (22 years, 3 months ago) |
  |
|
    |
 |
adam
Forum Moderator & Developer

Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Fri Jan 24, 2003 6:40 pm (22 years, 3 months ago) |
  |
that's what I was getting at, I added index.php for good measure. |
________________________________ It's turtles all the way down... |
|
     |
 |
php4ever
Junior WebHelper


Joined: 10 Oct 2002
Posts: 49
|
Posted:
Fri Jan 31, 2003 9:36 am (22 years, 2 months ago) |
  |
As it turns out, I was getting the bizarre error messages b/c apparently
the web server and/or database server where my site is hosted was
having problems.
Thankfully the problems are now gone. And, when I run the above script,
it runs fine despite my neglecting to add that trailing slash. However,
maybe it should be included. I noticed that almost everyone contributing
notes on php.net's documentation of fopen includes it when referring to urls with terminations like .net, .com, etc.
-- php4ever |
|
|
    |
 |
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.117652 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |