Closed Thread
Results 1 to 5 of 5

Thread: PHP error

  1. #1
    dirkfirst is offline Programming Expert
    Join Date
    May 2006
    Posts
    354
    Rep Power
    23

    PHP error

    I'm getting a strange error in PHP while trying to use CURL:

    Code:
    Error2 [60]: error setting certificate verify locations: CAfile: /usr/local/share/curl/curl-ca-bundle.crt CApath: none
    What causes this error? I'm connecting to paypal and trying to create a gateway.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    The problem is you are connecting to a secure site, you need to add some SSL constants to your curl code

  4. #3
    dirkfirst is offline Programming Expert
    Join Date
    May 2006
    Posts
    354
    Rep Power
    23
    hmm, how do I add SSL to CURL?

  5. #4
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20
    Code:
    <?php
       $ch 
    curl_init();
       
    curl_setopt($chCURLOPT_URL"https://www.paypal.com");
       
    curl_setopt($chCURLOPT_VERBOSE1);
       
    curl_setopt($chCURLOPT_USERAGENT,  "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
       
    curl_setopt($chCURLOPT_SSL_VERIFYHOST2);
       
    curl_setopt($chCURLOPT_RETURNTRANSFER,1);
       
    $returned curl_exec($ch);
       
    curl_close($ch);
       echo 
    $returned;
    ?>
    untested...

  6. #5
    Chan is offline Programming Professional
    Join Date
    Jun 2006
    Posts
    205
    Rep Power
    0
    I tweaked this a little bit and it worked. Thank you for your help.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [help]Parse error: syntax error, unexpected $end
    By kiddies in forum PHP Development
    Replies: 3
    Last Post: 07-18-2010, 02:58 PM
  2. Replies: 5
    Last Post: 06-20-2010, 10:52 PM
  3. Replies: 1
    Last Post: 06-18-2010, 05:26 AM
  4. My error-free code has an error. (Switches/Cases)
    By Sundosia in forum C and C++
    Replies: 3
    Last Post: 08-07-2008, 12:16 PM
  5. Replies: 1
    Last Post: 05-06-2008, 05:16 AM

Tags for this Thread

Bookmarks

Posting Permissions

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