Is the new API (v.3) compatible with PHP 4?

Is the new API (v.3) compatible with PHP 4, or will it only work with PHP 5?

I'm asking because when I was testing the client/create.php file and got the following error back:

Notice: Error making request with curl_error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134) in /mysite/lib/cm/class/transport.php on line 85
Result of POST /api/v3/clients
Failed with code 0

This is on a server running PHP 4.4.9.

Kshock, 5 years ago

Never mind, found the fix to the curl/SSL problem elsewhere.

I can confirm, however, that v.3 of the API does appear to work fine with PHP 4.

davidh, 5 years ago

A few people are having trouble with SSL through the API v3 PHP wrapper. The problem is that cURL does not include any root certificate authorities by default.

We will release a new version of the PHP wrapper in the next few weeks that should fix this problem.

In the meantime you can use http without SSL by passing 'http' in to the wrapper creation methods like this:

$wrap = new CS_REST_Campaigns(NULL, 'Your API Key', 'http');

At the moment this is our recommended workaround for anyone who is having trouble with SSL.

The other option is for you to install a certificate yourself. This link (towards the bottom) has instructions on how to do this with the root CA package from your browser.

jjosephs, 5 years ago

Thanks for the info David. Really helped me out of a jam.

tobyb tobyb, 5 years ago

Just to follow up, this issue has been fixed in the current version of the PHP wrapper.

natatkinson, 5 years ago

I just downloaded the latest PHP wrapper this morning, and when I first started workign wiht the API, everything worked fine.  Then I came back after lunch, and without changing any code, I got this error - any idea what the problem coudl be?  When I added the 'http" in with the call, it works fine

Jonny, 5 years ago

@tobyb do you mean that as of some point yesterday the PHP wrapper was updated? I downloaded it yesterday morning and am running into this error. The work-around posted above does work at least :-)

lehongduc87, 5 years ago

It has not really worked. I tried to get updated PHP wrapper yesterday, but this error is not fixed.
The updated code only fixed 'required_once some files'. Is it?

wrexual, 5 years ago

Update: Issue seems to have resolved itself

I seem to be running into this issue too, using PHP 5.2

Similar to natatkinson, I began working with the API about an hour ago and it worked fine. Now, I'm running into the same issues and I haven't made any changes to the code on my site.

Severity: User Notice

Message: Error making request with curl_error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Filename: class/transport.php
Line Number: 90

I only downloaded the PHP Wrapper a couple of hours ago so it should include the fix that Toby is talking about... I'm just not sure what's changed in the hour since I began working with the API. Any tips?

tobyb tobyb, 5 years ago

We pushed a change to the wrapper mid December which included the root CA certificate for openSSL to use. The changes made are here:

We're looking into the issue and will let you know when the problem has been fixed.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free