1

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

2 Answers 2

2

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

3
  • 1
    I am with Siteground. I tried the command you suggested and it had progressed to the following issue: bin/magento must be run as a CLI application Commented May 21, 2016 at 12:40
  • 1
    Used the following command and solved the issue: /usr/local/php56/bin/php-cli Commented May 21, 2016 at 13:09
  • 1
    I'm also hosting my site with siteground thats what! I ran the command through ssh, and ofcourse if you add cron job etc from cPanel, you have to use full command as you did. Glad it helped!
    – HassAn
    Commented May 22, 2016 at 6:34
0

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.