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
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
-
1I 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 applicationHemal Parekh– Hemal Parekh2016年05月21日 12:40:25 +00:00Commented May 21, 2016 at 12:40
-
1Used the following command and solved the issue: /usr/local/php56/bin/php-cliHemal Parekh– Hemal Parekh2016年05月21日 13:09:27 +00:00Commented May 21, 2016 at 13:09
-
1I'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– HassAn2016年05月22日 06:34:44 +00:00Commented May 22, 2016 at 6:34
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
Explore related questions
See similar questions with these tags.