Not a bug XF 1.5.4: PHP 7.0.1 Conflict with Forum API

Gene Steinberg

Well-known member
In troubleshooting a problem we had with a PHP script that connects to your API to login to a member upgrade area to allow for an RSS feed of our premium audio and video content, we persuaded a Plesk tech to look over our script to see why it wasn't working with PHP 7.0.1. It wouldn't allow a login.

His conclusion:

Checked, the actual problem is at forum API script - it is not compatible with PHP 7
/forum/api.php
The feed script works well itself.

There were multiple errors like:
Fatal error: 'break' not in the 'loop' or 'switch' context in forum/api.php on line 248
Fatal error: 'break' not in the 'loop' or 'switch' context in forum/api.php on line 475
and so on.

I've commented out these lines, and now it seems to work.

So is there a PHP 7.0.1 conflict you need to work through?

What do we lose by commenting out those commands/functions?
 
It was an open source third-party XenForo script, api.php. You can search for it online. Current version appears to work without alteration.

I'm on a cPanel server now with FPM-PHP and PHP 7.0.9. All is well.
 
Back
Top Bottom