PHP Parse error: syntax error, unexpected '[', expecting ')' in /var/www/vhosts/mydomain/bin/magento on line 22
via ssh when type bin/magento setup:upgrade.
I'm using magento 2 with data migrate from magento 1.9 via magento migrate tool
thx for the answer.
Solved! Go to Solution.
I have checked via phpinfo() the version and it is 7.0.4.
The DB version is correct because I had installed, previusly, magento 2 on this server.
The issue still persist
A server can use different PHP versions for the command line and for webserver.
Please ensure you have the proper PHP versions for the command line.
You can do it by executing the php -v command from the Magento 2 root folder.
I have executing the php -v and i get back:
PHP 5.3.3 (cli) (built: Feb 9 2016 10:36:17)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.6.0, Copyright (c) 2002-2014, by ionCube Ltd.
soon as possible I will set the php version.
I let you know if this fix the issue. Thanks for quick answer.
the bin/magento setup:upgrade works fine now.
It give me the follow message:
Please re-run Magento compile command
then I run bin/magento setup:di:compile
Compilation was started.
Interception cache generation... 7/7 [============================] 100% 2 mins 224.0 MiBBB MiB
Generated code and dependency injection configuration successfully.
But I get blank page on website and admin area.
How to diagnose Magento 2 errors: https://mage2.pro/t/307
it was a user permission gropu issues.
I ma having this problem with the hosting place, I did not know that CLI can use different versions of PHP, when I issue php -v from the root directory I get 5.3 version.
I have asked the hosting company and they said that PHP Alias defaults to 5.3, and have given me paths to use various CLIs, if I am understanding it correctly
If I want to issue a command such as reindex or static-content:deploy, do I issue the following form the root?
public_html]# php /usr/local/php56/bin magento static-content:deploy
Sorry it was my fault, NO PHP at the beginning
public_html]# /usr/local/php56/php-cli bin/magento setup:static-content:deploy