Support » Fixing WordPress » Parse error: syntax error, unexpected ‘function’ (T_FUNCTION)

  • amoralutero

    (@amoralutero)



    Hi, right now I have this error on my website:

    Parse error: syntax error, unexpected ‘function’ (T_FUNCTION), expecting while (T_WHILE) in /home2/hatha/public_html/libertadfemenina.com/wp-includes/plugin.php on line 623

    It happened after I made a backup on my website redirected the domain. The php version my hosting provider is running is 5.6

    This are the lines of code:

    function has_action($tag, $function_to_check = false) {
    return has_filter($tag, $function_to_check);
    }

    I appreciate any help!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Radu

    (@broseph)

    Hello!

    Your outdated PHP version can be one cause.

    Your theme or a plugin is trying to use more advanced PHP features which you don’t have because you’re on PHP 5.6.

    Updating your PHP version might fix this and other future issues.

    But someone with web development experience might have another fix for you.

    That’s the only one that I can think about.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Support Volunteer

    This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    If you can install plugins, install “Health Check”: https://wordpress.org/plugins/health-check/ On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site. You can then use its admin bar menu to turn on/off plugins and themes one at a time.

    See http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/

    Hi! Thanks for your replies, I will try it and be back to let you know how it worked out.

    Unfortunately, deactivating the plugins through FTP using the wpbeginner guide didn’t allow me to log in to my WordPress dashboard, I still see the exact same error on the screen…

    I haven’ tried the PHP upgrade. Should I ask my host for this? Or it’s something I can do on my own?

    I really appreciate your help.🙏🏽

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Support Volunteer

    Also reset your theme — just rename the active theme’s folder to something to forxe WP to use a default theme.

    The safest way is to talk to your host, not to do it alone. They might not allow you to upgrade the PHP version or they might not even support a higher version.

    Reset your theme first, though, as pointed out above. See if that works.

    Perform a full website backup before asking your host about the PHP upgrade.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.