Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2001
    Location
    Dallas
    Posts
    47

    Crazy problem with curl...need help!

    I'm trying to run curl on my server and I have some crazy problems. Just so you know this is the version info:
    _______________
    curl 7.12.3 (i386-redhat-linux-gnu) libcurl/7.12.3 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6
    Protocols: ftp gopher telnet dict ldap http file https ftps
    Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
    _______________

    When I try to run curl from within a php script, I get unable to establish connection. When I simply run it from the command line, it pulls down all the data fine.

    Any ideas? Here's the script that won't work.

    ________
    <?php


    $url="https://secure.authorize.net/gateway/transact.dll";

    $ch=curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch,CURLOPT_URL,$url);
    ob_start();
    curl_exec($ch);
    $paypal_array=ob_get_contents();
    curl_close($ch);
    ob_end_clean();

    if(empty($paypal_array)) { echo "Unable to establish connection."; } else { echo "Connection successfully established."; }

    print_r($paypal_array);
    ?>
    _______________

    Ideas? Thanks for the input.

    CS

  2. #2
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    I'm not sure what is the problem here, it is definately not your code. I copy pasted it directly and it worked as expected. I'm using PHP with libcurl/7.15.0 OpenSSL/0.9.7e zlib/1.2.3

    Try upgrading your cURL version and trying again.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  3. #3
    Did you figure this out? I have the exact same problem.

    PS: I'm also wondering if this could be related to my horde not working anymore to.

  4. #4
    Join Date
    Sep 2005
    Location
    Southern California
    Posts
    179
    Works fine for me with:

    curl
    CURL support enabled
    CURL Information libcurl/7.14.0 OpenSSL/0.9.7e zlib/1.2.1

    Try upgrading curl as fyrestrtr said.

    Also make sure that your php.ini (or your webhost's if applicible) allows those commands (although i think it would spit an error if they didn't);

    You can try turning error reporting on to E_ALL too

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •