cancel
Showing results for 
Search instead for 
Did you mean: 

PHP 5.4 v 7.2

SOLVED
Highlighted
Occasional Participant

PHP 5.4 v 7.2

Hi,

 

We have a very simple php script that creates a campaign and then schedules it.  It works and has worked great for a few weeks now using php 5.4.  We were upgrading our servers to php 7.2 and the script will not run anymore.  We have downloaded the most recent version of the files from github.  No errors are logged and we just get a blank screen. With a little debugging we found it is when it tries to add the campaign:

return $cc->emailMarketingService->addCampaign(ACCESS_TOKEN, $campaign);

 

Is the API compatible with php 7.2?

 

Thanks!

Doug

6 REPLIES
Moderator

Re: PHP 5.4 v 7.2

Hello @digitalBG,

 

Thank you for reaching out to Constant Contact's API Support.

 

PHP 7.2 should be working; however we have not had the chance or need to test specifically with that version yet. Please give us some time to test and get back to you with our findings.


Regards,
Jimmy D.
Tier II API Support Engineer
Occasional Participant

Re: PHP 5.4 v 7.2

ok, thanks!  Literally all I am doing is going into cpanel and changing the PHP version from 5.4 to 7.2 (or any 7) and the script that worked before that stops working.  I change it back to 5.4 and refresh the page and it works.

Moderator

Re: PHP 5.4 v 7.2

Hello,

I know that there are a lot of changes and incompatibilities when moving from 5.x to 7.x, and it is possible that our SDK wrapper library is using a method that is no longer supported in 7.x.

If you are seeing a blank screen, you are likely having a PHP error. I would check to see that errors and warnings are turned on in your php config and try again. This could clue us in on what the problem might be running into.

Regards,
David B.
Tier II API Support Engineer

Occasional Participant

Re: PHP 5.4 v 7.2

with errors on we get:

Fatal error: Cannot use lexical variable $eventName as a parameter name in /home/ZZZZZZZZZ/public_html/_e/vendor/guzzlehttp/guzzle/src/Event/Emitter.php on line 48

 

 

Moderator

Re: PHP 5.4 v 7.2

Hello,

 

Thanks for that information. It looks like the issue is that the version of a 3rd-party library we use, Guzzle (5.1.0), is not compatible with PHP 7.2. We do have an alpha version of our PHP library which does use Guzzle 6. Here is a link to where you can get this version: https://github.com/constantcontact/php-sdk/releases/tag/3.0.0-alpha

 

Since we are in the process of developing and releasing our new v3 API, we are not likely to make any major updates to our existing wrapper library, but if you need to move to PHP 7.2, the pre-release version may suit your needs.

 

Regards,
David B.
Tier II API Support Engineer

 

Moderator

Re: PHP 5.4 v 7.2

We received word that the Alpha branch worked for this situation.


Regards,
Jimmy D.
Tier II API Support Engineer
Still need help?
You can post a new message in the Community or find us on Twitter Mon-Fri 8am - 8pm ET. We've got real people waiting to help you out. Click below to start a conversation!