WordPress.org

Support

Support » Plugins and Hacks » [Resolved] syntax error only in some occasions

[Resolved] syntax error only in some occasions

  • Hi,

    I’m the author of the plugin WP-Table Reloaded.

    I just released a new version. A few users now told me that they could not activate the plugin anymore because they get the following error message:

    Plugin could not be activated because it triggered a fatal error.

    Parse error: syntax error, unexpected ‘;’, expecting T_FUNCTION in */wp-table-reloaded/wp-table-reloaded-admin.php on line 1609

    The weird thing is: I do not get this message on any of my systems and (so far) it’s only 3 people reporting the issue (there might be more though that just didn’t report it).
    They all run PHP5 on different operating systems.
    But I also tested it with different version of PHP5 and can not reproduce the error. There are no double semicolons and I could not find any missing braces or brackets.

    Can you guys help me? It would be awesome if you could download the latest developer build from
    http://downloads.wordpress.org/plugin/wp-table-reloaded.zip
    and could try to find this syntax error. Maybe your editors show it with their syntax higlighting.
    I have absolutely no clue where it might be as I am not even getting the error message.

    Any hints are appreciated!

    Thanks a lot!
    Tobias

Viewing 15 replies - 1 through 15 (of 15 total)
  • Downloaded zip to local pc then used the install from zip mechanism, then successfully activated on:

    2.7.1 linux shared hosting php5
    2.7.1 xampp on local pc php5
    2.8bleeding xampp on local pc php5

    Moderator cubecolour

    @numeeja

    I am one of the people that has mentioned this issue to Tobias.

    The version of php that is affected for me on WP 2.7.1 with Tobias’s plugin is php 5.2.9 on a linux server with apache. It works fine with php 4.4.9 on the same server.

    Michael

    And I’m another of the people that has mentioned this issue to Tobias.

    The version of PHP that is affected for me on WP 2.7.1 with Tobias’s plugin is PHP 5.2.8 on my localhost server running under WAMP 2.0.

    I haven’t yet tried it on a production server but I will and report back.

    Good on Tobias for his efforts to track this down!

    John

    Hi,

    thanks for your replies already!

    Here is a list of PHP version that do show the error message (as reported by the 3 users):
    PHP 5.2.6, PHP 5.2.8, PHP 5.2.9

    I successfully use the plugin (without the error message) on:
    PHP 5.2.4, PHP 5.2.6, PHP 5.2.9

    Also the operating systems are different (There are Windowses and Linuxes were it works and some where it doesn’t.)

    This let’s me come to the conclusion that this problem might be caused by something else besides my plugin. I just don’t understand how the same PHP versions can show a parse error for one person, but not for the other.

    To make things even more difficult: Version 1.1 of the plugin seems to have worked for the reporting users. (You can get it from the release archive at http://wordpress.org/extend/plugins/wp-table-reloaded/download/)

    So, my question to PHP insiders: Might this be caused by things like encoding problems or extraction from the zip-file?
    Could it be a WordPress issue? Or could it be caused by another plugin (maybe one that was loaded before)?

    Thanks!
    Tobias

    Sorry, I didn’t put this before:

    PHP 5.2.9 on shared Linux, Apache 1.3.41 (Unix)
    PHP 5.2.5 on XAMPP for Windows Version 1.6.6 Apache/2.2.8 (Win32)

    Tobias wrote: “Maybe your editors show it with their syntax higlighting.”

    I’ve just put wp-table-reloaded-admin.php through my TextPad PHP5 syntax checker and everything looks suitably pretty. And which also seems to suggest that there were no zip extraction problems. So ???

    John

    Further findings:

    1) Version 1.1 of the plugin does install and activate without problems on my localhost development server using PHP 5.2.8 running under WAMP 2.0.

    2) Version 1.2 of the plugin installs and activates without problems on a client’s production server using PHP 5.2.0-8+etch10 under Linux.

    It’s really looking like an obscure bug in the parser of some PHP 5 versions that just happens to be triggered by Tobias’ 1.2 code 🙁

    John

    I should also eliminate two other suspects that Tobias suggested: “Could it be a WordPress issue? Or could it be caused by another plugin (maybe one that was loaded before)?”

    Both the dev server and the prod server in my previous message have identical WP (2.7.1) and plugin installs.

    John V

    Hi,

    wow John! Thanks for testing all this!

    Does anyone know a good PHP forum or something like that were we could ask the PHP experts?

    Thanks!
    Tobias

    Hi,

    I had another user report the problem today. I asked him to provide his version information here. We’ll see.

    I’ll ask my question from above again: Does anyone know a good PHP forum or something like that were we could ask the PHP experts?

    Tobias

    If the php.ini setting short_open_tag=off then you get the issue.

    See line 1049 , you didn’t use here <?php :

    </form>
    <?
    } else { // end if $tables
     echo "<div style=\"clear:both;\"><p>" . __( 'wp-Table by Alex Rabe seems to be installed, but no tables were found.', WP_TABLE_RELOADED_TEXTDOMAIN ) . "</p></div>";
    }
    Moderator cubecolour

    @numeeja

    Well spotted Alex – That was it.

    After making the change on the WP installation that had the issue, the plugin now activates and works just as it should.

    Hi Alex,

    thanks VERY much for finding this!
    I’ll release a version where this is fixed this afternoon.

    One curios question: How did you find this? Special tools? Just good knowledge of the error message? Plain intuition?

    Thank you so much!

    Tobias

    Hi,

    I fixed the bug and releases a new version 1.2.1 which should work for everybody now.

    The release announcement: http://tobias.baethge.com/2009/05/wp-table-reloaded-121-bugfix-release/
    Download: http://tobias.baethge.com/wordpress-plugins/wp-table-reloaded-english/

    Thanks to all bug reporters and contributors!

    Tobias

    Reconfigure your local test installation always to the worst case, I had the same issue a long time ago with my plugins, since this time I disable short_open_tag always

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Resolved] syntax error only in some occasions’ is closed to new replies.