The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cant resolv domains from php?

Discussion in 'General Discussion' started by gdns, Oct 19, 2007.

  1. gdns

    gdns Active Member

    Joined:
    Feb 12, 2007
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    apache 2, php 5.2.4

    current uptodate version of cpanel..

    for some reason the fsockopen/fopen (url) cant open anything that is not within /etc/hosts

    if ip and hostname is placed in /etc/hosts, all works fine, if not:

    Warning: file_get_contents() [function.file-get-contents]: couldn't resolve host name in

    uname -a
    FreeBSD web2.m00m00.de 6.2-RELEASE-p8 FreeBSD 6.2-RELEASE-p8 #6: Fri Oct 12 17:23:48 CEST 2007
     
  2. tywe

    tywe Member

    Joined:
    Oct 13, 2007
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    same issue over here.. it's probably a security thing, but connecting to external sites from PHP scripts is definitely a requirement!
     
  3. tywe

    tywe Member

    Joined:
    Oct 13, 2007
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    ok, I was able to get around this by changing my PHP code to use CURL function calls to retrieve the external web page instead of fopen() .. Not necessarily a solution that is always doable, but probably the best one..
     
  4. gdns

    gdns Active Member

    Joined:
    Feb 12, 2007
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    http://bugs.php.net/?id=43057


    i'm not the one telling my clients to reprogram there webpages to use curl.. a fix would be better :)
     
  5. DevBreak

    DevBreak Active Member

    Joined:
    Jun 26, 2006
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    0
    same issue here

    FreeBSD 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Sat Feb 16 08:17:44 EET 2008
     
Loading...

Share This Page