1

I tried to clone our online WordPress website to localhost (using XAMPP) by following this tutorial: https://looks-awesome.com/copying-live-wordpress-site-localhost

Everything was easy to understand and went smoothly until I tried to load the website. Whenever I try to open index.php or wp-admin I am shown this error: "Fatal error: Uncaught Error: [] operator not supported for strings in C:\xampp\htdocs..." . It references php files for different themes and plugins.

After navigating to the PHP code in question it does indeed seem that the [] operator is being used on strings. Why does this all work fine on our live website but not locally? Is there a way to troubleshoot and fix this?

Thank you for your time!

1
  • 1
    Check the PHP version. Commented Sep 20, 2018 at 17:53

1 Answer 1

2

It is a different version of PHP you are using in your localhost and you are using themes and plugins which are not compatible with php >= 7.1 As of PHP 7.1, php syntax that previously allowed one to simultaneously create a sub-dimension on an array with a element in that new array is not allowed if that array index was set to a string. Downgrade your localhost PHP version to 5.6 and it will work correctly

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.