Problems calling curl_init()

Status
Not open for further replies.

engineman

New Member
Messages
19
Reaction score
0
Points
0
I'm having trouble setting up a cURL session. I know that the recent PHP changes disabled cURL by default, but I upgraded to version 2 PHP access today, and my account control panel shows that my current PHP access is Intermediate (version 2), and so I should be able to use the cURL functions. Do I have to wait for a while after the upgrade for cURL access to take effect or is there something else that I'm doing wrong?

Code:
Fatal error:  Call to undefined function curl_init() in /home/enginema/php_nvp_api/CallerService.php on line 45
I am on the absolut server engineman.exofire.net.

Thanks,
engineman

Here are the relevant parts of my code:

Code:
<?php
/****************************************************
CallerService.php

This file uses the constants.php to get parameters needed 
to make an API call and calls the server.if you want use your
own credentials, you have to change the constants.php

Called by TransactionDetails.php, ReviewOrder.php, 
DoDirectPaymentReceipt.php and DoExpressCheckoutPayment.php.

****************************************************/
require_once 'constants.php';

$API_UserName=API_USERNAME;


$API_Password=API_PASSWORD;


$API_Signature=API_SIGNATURE;


$API_Endpoint =API_ENDPOINT;


11.11.0-RELEASE_16983=VERSION;

session_start();

/**
  * hash_call: Function to perform the API call to PayPal using API signature
  * @methodName is name of API  method.
  * @nvpStr is nvp string.
  * returns an associtive array containing the response from the server.
*/


function hash_call($methodName,$nvpStr)
{
    //declaring of global variables
    global $API_Endpoint,11.11.0-RELEASE_16983,$API_UserName,$API_Password,$API_Signature,$nvp_Header;

    //setting the curl parameters.
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$API_Endpoint);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Does this work now, I think Bryon recompiled it into PHP.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
The CURL extension is compiled into versions 2 and 3 of PHP on Absolut (The server that you are on).

The server hasn't updated your PHP version yet. It can take up to three hours to update your PHP version once your application is accepted. I'll have it update now for you though.
 
Last edited:

engineman

New Member
Messages
19
Reaction score
0
Points
0
ok. Thanks a lot. It still doesn't seem to be working, but I will check it again in a couple of hours to see if the problem is fixed.

Thanks.
Edit:
It's still not working. I installed a test copy of XMPP on my personal machine and got the exact same error. I checked the php.ini file and the curl extension was commented out. Uncommenting the line and restarting Apache fixed the problem. Could you double check that everything is working right with PHP and cURL for PHP Version 2.

The web page that is giving me the error is: http://engineman.exofire.net/apps/MassPayReceipt.php
 
Last edited:

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
I'm looking into this more now

Edit: Okay so.. I recompiled versions 2 and 3 to include CURL earlier. I just checked to see if your account was updated to version 2 of PHP, and it was not -for some reason it had not updated from the default version. I ran the script again and it appears that it updated now.

At the URL you provided I do not see any PHP errors. Is it now working for you?
 
Last edited:
Status
Not open for further replies.
Top