2

I am trying to install Magento, but it showing me error:

syntax error, unexpected '.' in E:\wamp\www\Magento\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php on line 93

as per the suggestion's I had upgrade my php version. The problem is solve for temporary. After completion of installation the message show as:

System messages

One or more indexers are invalid. Make sure your Magento cron job is running.

On searching on this topic I got suggestion to run following command:

php bin/magento indexer:reindex

but on running of this command it shows me error again:

syntax error, unexpected '.' in E:\wamp\www\Magento\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php on line 93

5

Note: wrong version of the php is a main issue

Try to run this command in command line:

php -v

It is possible that your cli php is different from the server's php (cli php version is older than php version used by your server). If this is so, try to change path to the php used in cli.

Your problem occurs in a line of arguments of this method:

protected function createObject($type, $args)
{
    return new $type(...array_values($args));
}

becouse your cli php can not understand (parse) the ... symbols (Argument Unpacking) that is available for the php versions >= 5.6 .

PS: Here you can find an answer for the question "How to check php version on windows command line"

  • 1
    Just got this issue, and it turns out I was using PHP 5.5 so changed to PHP 7 and it was fixed :) – Zubair1 Jul 26 '17 at 23:27
  • 1
    @Zubair1 I'm glad to hear it :) As I said, wrong version of the php is a main issue. – Siarhey Uchukhlebau Jul 27 '17 at 6:45
  • @SiarheyUchukhlebau I am using PHP 7.0.33 (cli) still facing same issue in magento 2 running installation. – Rahul May 20 at 11:41
  • @Rahul seems like magento instalation (web server) use another version of the php. What says phpinfo() if you run it from web browser/curl? – Siarhey Uchukhlebau May 20 at 11:59
  • @SiarheyUchukhlebau php -v shows PHP 7.0.33 and phpinfo() shows PHP/7.0.33 – Rahul May 20 at 12:03
0

I have same issue in Magento 2.1.5 at the time of installation, and resolve the issue with update php version >= 5.6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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