1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Resolved Bug Reports' started by Gene Steinberg, Jan 12, 2016.

  1. Gene Steinberg

    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?
     
  2. Mike

    Mike XenForo Developer Staff Member

    This isn't a XenForo script though. I would guess it's from an add-on?
     
  3. Gene Steinberg

    Gene Steinberg Well-Known Member

    Well, I have to figure out where it came from. Thanks.
     
  4. Gene Steinberg

    Gene Steinberg Well-Known Member

    I found the source. You can delete this report. Thanks.
     
  5. rhodes

    rhodes Active Member

    I've got the same error. Can you please tell me how you fixed it @Gene Steinberg ? Thanks in advance.
     
  6. Gene Steinberg

    Gene Steinberg Well-Known Member

    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.
     
    rhodes likes this.
  7. rhodes

    rhodes Active Member

    Thank you @Gene Steinberg - an update also solved my problem.
     

Share This Page