php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55277 After OS X Lion upgrade, file_get_contents issues a warning
Submitted: 2011-07-24 19:10 UTC Modified: 2011-07-27 07:11 UTC
From: michaelozeryansky at hotmail dot com Assigned:
Status: Duplicate Package: *Network Functions
PHP Version: 5.3.6 OS: OS X Lion
Private report: No CVE-ID: None
 [2011-07-24 19:10 UTC] michaelozeryansky at hotmail dot com
Description:
------------
After I upgraded to Mac OS X Lion, my php script issues a warning for file_get_contents(). If I run the script a second time, there's no warnings.

This script runs when I open my browser to check if I'm logged into my schools network. Then if I'm not logged in, it uses curl to log in. but the problem is with file_get_contents().

I did test getaddrinfo() in a cpp program. When I used "http://www.google.com" it fails with the same error as php displays, but when I use "www.google.com" it succeeds. This didn't happen before, but could this be the problem? Then again the example on php.net is:
<?php
$homepage = file_get_contents('http://www.example.com/');
echo $homepage;
?>

Test script:
---------------
<?php

    $google = file_get_contents("http://www.google.com/");

?>

Expected result:
----------------
No warnings, like when I had OS X Snow Leopard.

Actual result:
--------------
Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/michael/Sites/personal/homepage.php on line 3

Warning: file_get_contents(http://www.google.com/) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /Users/michael/Sites/personal/homepage.php on line 3


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-27 06:36 UTC] laruence@php.net
Please check that your nameserver is running and setup
correctly.  Check the same with your internet server.
 [2011-07-27 07:11 UTC] laruence@php.net
-Status: Open +Status: Duplicate
 [2011-07-27 07:11 UTC] laruence@php.net
this is a duplicate, see #11058
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 10:01:25 2020 UTC