• Resolved rbennett

    (@rbennett)


    Still not working

    Parse error: syntax error, unexpected T_STRING in /home/content/78/8368878/html/wp-content/plugins/wptouch/core/class-cache-smash.php on line 104

    I don’t use W3 Total Cache. I use wp super cache.

    Thanks,
    Robin

Viewing 15 replies - 1 through 15 (of 20 total)
  • Chris

    (@janusdesign)

    i just updated and get the same fatal error:

    Parse error: syntax error, unexpected T_STRING in /wp-content/plugins/wptouch/core/class-cache-smash.php on line 104

    Chris

    (@janusdesign)

    ps i’m not using any caching plugins

    Same here. I cannot get to any page on my site….
    Not sure how to proceed but my entire site is down.

    Parse error: syntax error, unexpected T_STRING in /…/…/wp-content/plugins/wptouch/core/class-cache-smash.php on line 104

    Chris

    (@janusdesign)

    i had to disable the plugin, then the site came back up. now the plugin won’t activate due to the same error, but at least the site is up.

    @chris… How do I deactivate the plugin if I cannot get to the login page or any other on my site?

    Chris

    (@janusdesign)

    @sschober – you would need FTP access (or you could do it via File Manager in your web host control panel):

    go into the plugins folder /wp-content/plugins/ and rename the /wptouch/ folder something else like /ZZZ-wptouch/

    it’ll deactivate since it can’t find the plugin folder, then the site should come back up.

    Thanks! I took a little riskier route… I backed up the WPtouch plugin directory then renamed it and replaced it with a copy of the previous working version 4.2.6 folder and files. Will look for an updated version and test on off hours. I panic’d there for a few.

    Unless I am mistaken, it looks to me like version WPTouch 4.3 is using PHP namespacing.

    Here is the code that is failing (specifically line 104 of wptouch/core/class-cache-smash.php):

    if ( $w3tc_095_or_greater ) {
    	$w3_config = new \W3TC\Config( true );
    }
    else {
    	$w3_config = new W3_Config( true );
    }

    PHP Namespacing is only supported in PHP 5.3.x and above. If your hosting service is running PHP 5.2.x for your site, line 104 will cause the fatal error.

    You might try editing the file to check the PHP version:

    if (version_compare(phpversion(), '5.3.0', '>') && $w3tc_095_or_greater ) {
    	$w3_config = new \W3TC\Config( true );
    }
    else {
    	$w3_config = new W3_Config( true );
    }

    This seems to have worked for me, though I am in the process of updating my hosting to use a newer version of PHP, which will also fix this.

    • This reply was modified 8 years, 5 months ago by J. Max Wilson.

    Note: I also had to modify line 283 of the wptouch/themes/bauhaus/default/functions.php

    global $bauhaus_featured_posts;
    $settings = bauhaus_get_settings();
    $args = bauhaus_featured_get_args();
    $classes = [];
    if ( $settings->bauhaus_post_listing_autoplay ) {
    	$classes[] = 'autoplay';
    }

    Initializing Arrays in PHP using the [] syntax is only supported in PHP 5.4 and greater.

    So Line 283 needs to be changed to:

    $classes = array();

    The real solution is to contact your hosting company to make sure your website is running an updated version of PHP (5.6 or greater) since these older versions are no longer supported and may have security vulnerabilities. But for those who don’t have that option, these changes might work.

    • This reply was modified 8 years, 5 months ago by J. Max Wilson.
    Chris

    (@janusdesign)

    @jmaxwilson thank you for that info!

    Eesh, yikes, this is bad, made my whole site inaccessible.

    I have tried both making the above PHP changes and updating to the very latest version of WPTouch. Neither has corrected the issue, and my host is in no rush to update PHP past 5.2 — is that just the end of things then?

    Chris

    (@janusdesign)

    @themook while i’m sure they won’t be supporting old versions forever, i wouldn’t doubt they make some kind of fix in the next update as i’m sure there are a number of people still using older php and don’t have any other options or newer versions available yet.

    Chris

    (@janusdesign)

    @themook if you have the older version of the plugin backed up, you can upload that again as that should still work.

    Thanks for the replies, Chris. I restored an earlier version but it continued to display and act like v 4.3.1 in the Dashboard. Probably to do with caches or something — it was just easier to switch to another plugin for the time being than bother troubleshooting it.

    I’ll keep an eye out for future updates and hope they address the change (or that my host eventually update their PHP).

    Hello! I am having the same problem for my blog. In the 1and1 interface, there is the option for me to update the current PHP version to 5.6
    As I am not an expert in this language, would this update damage the data/content of my website?

    Thank you very much!
    Cristiana

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Fatal Error Still With 4.3 Update’ is closed to new replies.