Curl problem, need help !

Discussion in 'PHP' started by picos, Feb 8, 2010.

  1. #1
    Hi all,
    I have a trouble with Curl, I really dont know what happen !
    This is code:
    
    $ch = curl_init('https://perfectmoney.com/acct/confirm.asp');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0");
    if(curl_exec($ch) === false)
    {
        echo 'Curl error: ' . curl_error($ch).'|'.curl_errno($ch);
    }
    else
    {
        echo 'Operation completed without any errors'.curl_errno($ch);
    }
    curl_close($ch);
    PHP:
    I run this script in my localhost, it work properly.
    But when i uploaded to 2 servers and ran it,
    It returns an error: Curl error: couldn't connect to host|7
    Otherwise, if i replace URL by "https://api.libertyreserve.com/xml/transfer.aspx", it works properly(in both localhost and server).
    Can someone help me with this problem ?
     
    picos, Feb 8, 2010 IP
  2. spyka

    spyka Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    CURL error 7 means that it couldn't connect to the domain.

    If other domains work, and you're sure the URL is valid, then a setting somewhere is mixing stuff up. It could be that domain is blocked, or the security certificate is causing problems
     
    spyka, Feb 8, 2010 IP
  3. prat20009

    prat20009 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    check on another server.. there may be some problem in the server you are running.. it worked fine on my server when i tested with your URL
     
    prat20009, Feb 8, 2010 IP
  4. picos

    picos Active Member

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #4
    yes, i tested with 3 server, they have the same problem,
    CAN NOT CONNECT HOST !
    but when i try to run in my localhost, it is good.
    work properly.
    prat20009: you test in your localhost or server ?
    spyka: yes, URL is correct
     
    picos, Feb 8, 2010 IP
  5. picos

    picos Active Member

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    81
    #5
    can someone please help me, very urgent !
     
    picos, Feb 8, 2010 IP
  6. beacon

    beacon Peon

    Messages:
    93
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i run from localhost and my srver - work fine 'Operation completed without any errors0'
     
    beacon, Feb 9, 2010 IP
  7. blacksheep666

    blacksheep666 Active Member

    Messages:
    68
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #7
    i think there is a problem with curl on your server...
     
    blacksheep666, Feb 9, 2010 IP
  8. eosan

    eosan Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hello picos,
    This issue also happen with me.
    Did your fix it?
    Please help.
    Thank you!
     
    eosan, Feb 22, 2012 IP