Question

I am trying to install a theme on Magento 2.06. When I try to run the following command: php bin/magento setup:upgrade but I receive the following error:

Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected '[', expecting ')' in <b>/home/bargaink/public_html/test/bin/magento</b> on line <b>22</b><br />

Any idea what the issue is?

Thanks

HP

Was it helpful?

Solution

I had the same issue, got fixed after talking to my hosting provider. Do you mind telling me your hosting provider?

try this command:

php56 bin/magento setup:upgrade

It will then use php version 5.6 which is required in Magento 2. Hope this would help

OTHER TIPS

My guess is your problem is triggered by this line

set_error_handler([$handler, 'handler'])

This error is thrown because you're running PHP < 5.4 and the use of [] instead of array() has been introduced with 5.4

Magento 2 requires PHP 5.6 or PHP 5.5.22 to run properly I reckon you should upgrade PHP to fix that problem.

Magento 2 system requirements: http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top