#1
  1. I lov C in AIX/Linux, hate C++
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jul 2003
    Location
    Jacksonville, Florida
    Posts
    1,655
    Rep Power
    38

    fsockopen() error, permission denied


    Hi Everyone!

    Sample code below...

    --snip--
    $fp = fsockopen("www.cnn.com", 80, $errno, $errstr, 30);
    --snip--

    I get the error message, permission denied along with 13. When I read the bugs.php.net and found out that I need to add the "@" to it so I did this..

    --snip--
    $fp = @fsockopen("www.cnn.com", 80, $errno, $errstr, 30);
    --snip--

    I get a different error message, it said ...

    --snip--
    Addr family not supported by protocol (66)
    --snip--

    Does anyone know what it meant and what is the workaround to it?

    Thanks,
    FletchSOD
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    South Yorkshire
    Posts
    442
    Rep Power
    28
    What system is this on? Can you hit anyother hosts? or is it just www.cnn.com
    regards,

    pgudge
  4. #3
  5. I lov C in AIX/Linux, hate C++
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jul 2003
    Location
    Jacksonville, Florida
    Posts
    1,655
    Rep Power
    38
    Originally Posted by pgudge
    What system is this on? Can you hit anyother hosts? or is it just www.cnn.com
    Unix/Linux... All other hosts beside www.cnn.com. I just don't know why fsockopen() doesn't work. I'm using PHP version 4.3.1

    FletchSOD
  6. #4
  7. No Profile Picture
    Moderator/Software QA Engineer
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    Location
    Anaheim, CA (USA)
    Posts
    6,650
    Rep Power
    2480
    Originally Posted by The PHP Manual
    If the value returned in errno is 0 and the function returned FALSE, it is an indication that the error occurred before the connect() call.
    Check this. If fsockopen returns false, is errno zero?
    ~~ Peter ~~ :: ( Who am I? ) :: ( Peter's Musings: Uploading myself, bit by bit... ) :: ( Electronic Frontier Foundation ) :: ( I'm a GNU/Linux addict and Free Software Advocate. ) :: ( How to Ask Questions the Smart Way ) :: ( The Fedora Project, sponsored by Red Hat ) :: ( GNOME: The Free Software Desktop Project ) :: ( GnuPG Public Key ) :: ( About me on the WIki )
  8. #5
  9. I lov C in AIX/Linux, hate C++
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jul 2003
    Location
    Jacksonville, Florida
    Posts
    1,655
    Rep Power
    38
    Well, it said the errno is 66 as posted, along with the error message...

    Well, I'm thinking about not going to use fsockopen if this persist. I found out that I have this same problem with fopen too. Weird.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    South Yorkshire
    Posts
    442
    Rep Power
    28
    Do you have full access to apache / php configuration or is it on a webserver hosted somewhere? If so then they might have restricted access to extrenal links via php.

    If not, then i'm not use, check all your extenstions are there, and being loaded, and that they're are no bugs with the version of the extension.
    regards,

    pgudge

IMN logo majestic logo threadwatch logo seochat tools logo