• Resolved rajashrihj

    (@rajashrihj)


    [14-Feb-2021 11:07:19 UTC] PHP Parse error: syntax error, unexpected ‘:’, expecting ‘{‘ in /home/write2sk/public_html/wp-content/plugins/woocommerce/woocommerce.php on line 57

    I’m getting the above error when I try to load the website. How to resolve it. Anyone please help me with this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter rajashrihj

    (@rajashrihj)

    Here is the code where I’m getting error:

    function wc_get_container() : \Psr\Container\ContainerInterface {
    return $GLOBALS[‘wc_container’];
    }

    • This reply was modified 4 years, 1 month ago by rajashrihj.
    function wc_get_container() {
    return $GLOBALS[‘wc_container’];
    }

    That maybe works?

    Thread Starter rajashrihj

    (@rajashrihj)

    That error resolved. But same error it is showing in other codeblock.

    public function add( string $class_name, $concrete = null, bool $shared = null ) : DefinitionInterface {

    Error is pointing to this line.
    Any solution to this…

    All these codes are pre generated. While working in the localhost, there were no errors. It was working fine. When hosted the site, all these errors are coming.

    • This reply was modified 4 years, 1 month ago by rajashrihj.

    Seems like either you are missing some files or you are using plugin that overrides function incorrectly.

    try reinstalling woocommerce and if that doesn’t work try to disable all the plugins.

    functions should not have : after the brackets of the function, but maybe it’s some modification woocommerce plugin has done.

    Thread Starter rajashrihj

    (@rajashrihj)

    I haven;t missed any files. I have uploaded the entire folder as a zip file and extracted. Tried reinstalling it but still isn’t working. By disabling it I’ll the functionalitites which I need. How can this be resolved.

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @rajashrihj. Have you been able to resolve this issue? If not, can you try re-installing WooCommerce via FTP?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP parse error’ is closed to new replies.