Closed Thread
Results 1 to 2 of 2

Thread: curl doesn't work

  1. #1
    userfish.olegs19 is offline x10Hosting Member userfish.olegs19 is an unknown quantity at this point
    Join Date
    Jan 2011
    Posts
    1

    curl doesn't work

    When I try to use curl it doesn't work, although phpinfo shows that it is installed.
    The same script work on my test home machine.
    here is a simple script:
    <?php

    function getPage($url,$post='')
    {
    $ch = curl_init();

    //echo $url;
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    if(!empty($post)) curl_setopt ($ch, CURLOPT_POST, 1);
    else curl_setopt ($ch, CURLOPT_POST, 0);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 30);

    $output = curl_exec($ch);
    //echo $output;exit;
    if (curl_errno($ch)) {echo "ERROR!!!" + curl_errno($ch);exit;}
    curl_close($ch);
    return $out;
    }

    $s=getPage("http://whatismyipaddress.com");

    echo $s;
    ?>

  2. #2
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: curl doesn't work

    Unfortunately, due to people creating proxy scripts that are strictly forbidden by the X10 hosting TOS, the outgoing port that CURL uses to fetch remote information is blocked. If you absolutely must use this functionality, you will have to look into upgrading your hosting to one of the premium services. We unfortunately cannot unblock ports for one user.

    If you are connecting to a known safe API of some sort, let us know because these shouldn't be disabled.
    Last edited by garrettroyce; 01-07-2011 at 08:35 PM.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

Closed Thread

Similar Threads

  1. cURL?
    By propctuner in forum Free Hosting
    Replies: 6
    Last Post: 11-09-2010, 02:42 AM
  2. Curl
    By cooljaipur in forum Free Hosting
    Replies: 1
    Last Post: 02-06-2010, 09:46 AM
  3. Help me cURL
    By tientrien in forum Free Hosting
    Replies: 3
    Last Post: 03-27-2009, 01:14 PM
  4. PHP Curl
    By oliversimon in forum Free Hosting
    Replies: 3
    Last Post: 04-08-2008, 07:07 PM
  5. curl
    By chongkolai in forum Free Hosting
    Replies: 1
    Last Post: 10-19-2007, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers