WordPress.org

Forums

WP-Piwik
[resolved] 0.9.9.9 gets me an error for whole wordpress (18 posts)

  1. olegsfinest
    Member
    Posted 1 year ago #

    after updating this plugin i got this error

    Parse error: syntax error, unexpected T_STRING in /var/www/gipfelblog-svn/wp-content/plugins/wp-piwik/wp-piwik.php on line 751

    by only visiting my domain.

    https://wordpress.org/plugins/wp-piwik/

  2. poldixd
    Member
    Posted 1 year ago #

    me too:

    Parse error: syntax error, unexpected T_STRING in /XXXXXX/wordpress/wp-content/plugins/wp-piwik/wp-piwik.php on line 751

  3. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Looks like you are using a deprecated version of PHP.

    You should upgrade at least to PHP 5.3. Older versions of PHP are no longer supported by the PHP team itself.

    See http://de3.php.net/downloads.php (current PHP downloads) and http://de3.php.net/releases/ (PHP 5.2 reached its end of life status at 6 Jan 2011).

    Also the latest versions of Piwik (since 2.0) require PHP 5.3.2 or greater, see http://piwik.org/docs/requirements/
    WP-Piwik requires Piwik 2.0.2 or higher since 0.9.9.7 (release 4 months ago).

    As a workaround until you are able to (or your hoster is up to) update PHP, you can comment the callPHP function in wp-piwik.php:

    Find line 741:
    function callPHP($strParams) {
    Change to:
    function callPHP($strParams) { /*

    Find line 757:
    }
    Change to:
    */ }

  4. poldixd
    Member
    Posted 1 year ago #

    Thank you! I added...

    AddHandler php53-cgi .php

    to the .htaccess and it works. My hoster is all-inkl.com.

  5. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for this hint!

    I will add this to WP-Piwik's FAQ section.

  6. olegsfinest
    Member
    Posted 1 year ago #

    Thanks for the quick help :)

  7. Art Project Group
    Member
    Posted 1 year ago #

    Works fine.

  8. kre8tiv
    Member
    Posted 1 year ago #

    Using PHP 5.5.3, also getting this error. htaccess-fix doesn't work but downgrading on piwik 9.9.8. Hoster: Domainfactory.

    Piwik-Version 2.2.0 running.

  9. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    I had a look into my Domainfactory account. The latest PHP version offered there is 5.4.9... can you recheck this? (df standard seems to be 5.2.14)

    You can also check your PHP version by using phpinfo:

    <?php
    phpinfo();

    If you are sure about your PHP version (5.3+), please post the full error message here.

    Thank you.

  10. dnordin
    Member
    Posted 1 year ago #

    I am running PHP version 5.4.19 (confirmed with phpinfo). After updating to the latest version of the plugin, when I try to access the admin area, I get the following error:

    Parse error: syntax error, unexpected T_STRING in /wp-content/plugins/wp-piwik/wp-piwik.php on line 751

    Also, I have the following line in my .htaccess file:
    addhandler x-httpd-php5-cgi .php

    I had to disable FastCGI for some reason that currently escapes me.

  11. dnordin
    Member
    Posted 1 year ago #

    To clarify, I still get the error message. I had previously disabled FasCGI for other reasons and was just explaining as much in my previous post (which I cannot edit for some reason).

    My previous post was meant to indicate that I still get that error with PHP version 5.4.19 with FastCGI disabled.

  12. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    1. Can you try this tool
      http://www.webconfs.com/http-header-check.php
      and check if there is a hint regarding your PHP version?

      Maybe you can see something like

      X-Powered-By => PHP/5.2.17

    2. To check the PHP version with phpinfo you should place your test file into WP-Piwik's folder... can you try this? Some users reporting this issue set their PHP version to PHP 5.3+ in their hoster's admin panel, but had a .htaccess configuration switching PHP back to 5.2.
  13. dnordin
    Member
    Posted 1 year ago #

    That tool doesn't indicate any PHP version information, unfortunately.

    Running phpinfo from a script placed in the WP-Piwik plugin folder, the PHP version is 5.4.19.

  14. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Line 751 in 0.9.9.9 contains
    Piwik\FrontController::getInstance()->init();

    0.9.9.10 should show the error in line 749, doesn't it?

    So we should discuss the question: Why cause namespaces an error in PHP 5.3 or higher?

    Can you try to execute this example on your server?
    http://www.php.net/manual/en/language.namespaces.basics.php
    (Copy file1.php and file2.php to your server and run file2.php)

    If this also causes an error, you should contact your host service and ask them about the PHP version, the PHP setup and namespaces. Otherwise I have to continue checking what's wrong with WP-Piwik.

  15. dnordin
    Member
    Posted 1 year ago #

    Running file2.php throws no errors and shows a page with only the text "212".

  16. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    And the example works in your WordPress home directory and in WP-Piwik's directory?

    I'm quite sure there is something wrong regarding your server configuration. In a German community different users are discussing a similar problem... and everybody can fix the issue by checking the configuration (hoster settings, server settings, .htaccess):
    https://www.xing.com/net/wordpress/installation-und-konfiguration-64290/fehler-nach-plugin-aktualisierung-46481316/46482967

    Maybe you can ask your hoster for some help? Can you tell me your hoster's name? (The issue is known with Domainfactory and 1&1, both German hosters).

  17. dnordin
    Member
    Posted 1 year ago #

    You're right; it was my configuration (the host is GoDaddy, by the way).

    After I commented out the "addhandler x-httpd-php5-cgi .php" line in my .httaccess file, it started working. I just wish I could remember why I had to add that line in the first place. At any rate, it works now. Thanks for the support!

  18. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, thank you very much for your feedback!

    I hope this will help also some other users.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Piwik
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic