• Resolved Ibby

    (@ibby)


    This message started appearing in cpanel server logs yesterday after updating to v5.8.0. The site is loading on frontend but admin is no longer accessible.
    I attempted to re-install v5.7.1 and v5.9.0beta1 but the issue persists. Not sure if it’s something server related but I’m scratching my head.

    The full error is:
    PHP Parse error: syntax error, unexpected ':', expecting '{' in /wp-content/plugins/woocommerce/woocommerce.php on line 57

    This corresponds to the following line in woocommerce.php:
    function wc_get_container() : \Psr\Container\ContainerInterface {

    The admin panel will not load and only brings up a 500 Internal Server Error. The development was being done on PHP80 so I forced the subdomain back to 7.4 via htaccess and verified using health tools and disabling the woocommerce plugin via FTP (the site loads perfectly when WooCommerce is disabled). Unfortunately, this didn’t work either.

    EDIT: Frontend is also not working now.

    • This topic was modified 3 years, 5 months ago by Ibby.
    • This topic was modified 3 years, 5 months ago by Ibby.
    • This topic was modified 3 years, 5 months ago by Ibby.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ibby

    (@ibby)

    Strange, now it’s back…

    The colon syntax in the function declarion was introduced in PHP 7. The code between the colon and the bracket is the return type declaration. WooCommerce requires PHP 7.4 minimum.

    If you are seeing this error, I would say that the server is actually using PHP 5.x despite your efforts.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Parse error: woocommerce.php on line 57’ is closed to new replies.