1

Im installing my Wordpress theme and when I click activate I get the following error:

Parse error: syntax error, unexpected '[' in E:\Websites\HostingSpaces\mov1\movies.in\wwwroot\wp-content\themes\wp_mov\functions_main.php on line 1114

Anyone have any idea of how fix it?

Kev Walsh
  • 39
  • 6
  • How do i show yee the php file? – Kev Walsh May 27 '16 at 23:34
  • 2
    I'm gussing your PHP version is lower than 5.4? The "short array syntax" was introduced in PHP 5.4, so if you are on a lower version I highly recommend you upgrade to a higher version (the alternative is to find a PHP <5.4 compatible WP install of your theme). – Qirel May 27 '16 at 23:34

1 Answers1

2

This is caused by new-style array initialization ("short array syntax"), introduced in PHP 5.4:

<?php
$myArray = ["one", "two", "three"];

$myAssociativeArray = [
    "key1" => "value1",
    "key2" => "value2",
];

You'll have to upgrade to PHP 5.4 or better. If you let me know what OS you're using, I can provide specific instructions.

More info can be found in the array type manual.

Will
  • 24,082
  • 14
  • 97
  • 108
  • im on a Cloud host. And i dont have cpanel just websitepanel. how would i update the php? are you familiar with websitepanel – Kev Walsh May 28 '16 at 00:26
  • Ah, no, not at all. Contact the web host and let them know you require PHP 5.4+. – Will May 28 '16 at 00:28
  • thanks will, ill see how i get on – Kev Walsh May 28 '16 at 00:52
  • No problem, glad to help! You may also look into getting a better website with more modern tools. PHP has improved greatly in the later 5.x releases. – Will May 28 '16 at 00:57
  • Hi again will. My host said they dont have php 5.4+ available for cloud host yet, what can i do? – Kev Walsh May 28 '16 at 12:29