Title: PHP parse error
Last modified: February 14, 2021

---

# PHP parse error

 *  Resolved [rajashrihj](https://wordpress.org/support/users/rajashrihj/)
 * (@rajashrihj)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-parse-error-29/)
 * [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](https://wordpress.org/support/users/rajashrihj/)
 * (@rajashrihj)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-parse-error-29/#post-14047500)
 * Here is the code where I’m getting error:
 * function wc_get_container() : \Psr\Container\ContainerInterface {
    return $GLOBALS[‘
   wc_container’]; }
    -  This reply was modified 5 years, 3 months ago by [rajashrihj](https://wordpress.org/support/users/rajashrihj/).
 *  [yotamdahan](https://wordpress.org/support/users/yotamdahan/)
 * (@yotamdahan)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-parse-error-29/#post-14047503)
 *     ```
       function wc_get_container() {
       return $GLOBALS[‘wc_container’];
       }
       ```
   
 * That maybe works?
 *  Thread Starter [rajashrihj](https://wordpress.org/support/users/rajashrihj/)
 * (@rajashrihj)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-parse-error-29/#post-14047567)
 * 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 5 years, 3 months ago by [rajashrihj](https://wordpress.org/support/users/rajashrihj/).
 *  [yotamdahan](https://wordpress.org/support/users/yotamdahan/)
 * (@yotamdahan)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-parse-error-29/#post-14047577)
 * 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](https://wordpress.org/support/users/rajashrihj/)
 * (@rajashrihj)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-parse-error-29/#post-14048077)
 * 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)](https://wordpress.org/support/users/drwpcom/)
 * (@drwpcom)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-parse-error-29/#post-14238098)
 * Hi [@rajashrihj](https://wordpress.org/support/users/rajashrihj/). Have you been
   able to resolve this issue? If not, can you try [re-installing WooCommerce via FTP](https://docs.woocommerce.com/document/installation-2/#section-3)?

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

The topic ‘PHP parse error’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 6 replies
 * 3 participants
 * Last reply from: [Damianne P (a11n)](https://wordpress.org/support/users/drwpcom/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/php-parse-error-29/#post-14238098)
 * Status: resolved