Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    May 2003
    Location
    uk
    Posts
    37

    Unhappy fsockopen Not Working

    I am trying to use fsockopen() in PHP and But it's giving me an error. I have tried it on both Windows IIS and Linux redhad 7.3 but both are unable to connect to any URL.

    $fp = fsockopen("http://www.abc.com/a.php", "80");

    as soon as this code executes it gives me following error:


    Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) on line 3

    Warning: fsockopen(): unable to connect to http://www.abc.com/a.php:80 on line 3


    Please tell me why this error is comming........

    cPanel.net Support Ticket Number:

  2. #2
    Member
    Join Date
    Apr 2003
    Posts
    142

    Default Re: fsockopen Not Working

    Originally posted by donnie
    I am trying to use fsockopen() in PHP and But it's giving me an error. I have tried it on both Windows IIS and Linux redhad 7.3 but both are unable to connect to any URL.

    $fp = fsockopen("http://www.abc.com/a.php", "80");

    as soon as this code executes it gives me following error:


    Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) on line 3

    Warning: fsockopen(): unable to connect to http://www.abc.com/a.php:80 on line 3


    Please tell me why this error is comming........

    cPanel.net Support Ticket Number:
    Change it to: $fp = @fsockopen("http://www.abc.com/a.php", "80");

  3. #3
    Member amal's Avatar
    Join Date
    Nov 2003
    Location
    India
    Posts
    153

    Exclamation

    Hi,

    If we add '@' to that, it just hides the warning message.. Is there any real fix for it... Telnet to the same website to port 80 from the server works.. But it's not able to connect from php..

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Do you have Sockets checked when you've built apache/php?
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  5. #5
    Registered User
    Join Date
    Apr 2005
    Location
    UK
    Posts
    1

    Lightbulb Curl

    Hi,

    Instead of using fsockopen, try using the CURL library.

    Alternatively, upgrade your PHP version.
    Last edited by cj-hosting; 04-15-2005 at 07:35 PM. Reason: typo

  6. #6
    Member amal's Avatar
    Join Date
    Nov 2003
    Location
    India
    Posts
    153

    Thumbs up

    I copied a php.ini from another server, and it works fine now... Only difference I could note over there was the
    "extension dir = ./ " in the old php.ini "

  7. #7
    Member
    Join Date
    Aug 2003
    Location
    india
    Posts
    23

    Cool

    Yes Amal, it is working when I removed the "./" for the "extension_dir" from the php.ini .
    vishnu

Similar Threads & Tags
Similar threads

  1. fsockopen won't connect on port 80 to akismet
    By WindyT in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 07-09-2009, 04:33 PM
  2. weird fsockopen() issue
    By Snowman30 in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 06-26-2006, 12:46 AM
  3. fsockopen() problem - urls not resolving
    By MMarko in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-29-2006, 01:33 PM
  4. Warning: fsockopen(): unable to connect to
    By itrends in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 06-17-2005, 01:51 AM
  5. fsockopen() problem.
    By anton_latvia in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-18-2005, 03:19 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube