cUrl script runs on DevDesktop but not on cloud

cUrl script runs on DevDesktop but not on cloud

4 posts / 0 new
Last post
brijesh@cmsminds.com's picture
brijesh
Points: 1
cUrl script runs on DevDesktop but not on cloud

Hi all,
I created a module which uses some cUrl script to exchange data between a payment gateway and my installation.
The thing is the code runs flawlessly on my DevDesktop setup, on both Mac & Windows. But the code doesnt run as it should on Cloud,

adding the code which isn't working on Cloud below,

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->PxPay_Url);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$inputXml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$outputXml = curl_exec ($ch);

curl_close ($ch);

// $inputXml contains the input xml
//$this->PxPay_Url contains request URL of the gateway

Status: 
Unresolved
dmyburgh's picture
david.myburgh
Points: 99

What errors do you get on Acquia Cloud? Are you doing this over SSL and if so, is it enabled correctly on AC? I have code that does curl things on AC, so curl does work correctly on our systems.

brijesh@cmsminds.com's picture
brijesh
Points: 1

I am not using SSL on my site the request is made to a gateway which uses https,

if the code runs successfully it should return a URL in $outputXML and returns "IK" as output when there is any issue.
I am new to cUrl, so no idea what that means.

On DevDesktop I just created the module on a new installation, everything worked fine and after uploading to cloud the same code isn't working.

I have a free developer account, might that be an issue?

Status Change: 
Unresolved
dmyburgh's picture
david.myburgh
Points: 99

The free account shouldn't affect anything. No idea what the IK thing is, but it sounds like it might be specific to your payment gateway, so check with them what it means. You can also try running the curl command from the command line to the gateway url and see what comes back to you. That might tell you something more.