magento 2 syntax error during installation, unexpected ‘.’ in AbstractFactory.php on line 93

Recently tried to install Magento v2.1 on a server but got the following error message:

PHP Parse error: syntax error, unexpected '.' in public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93

Line 93 in AbstractFactory.php is return new $type(...array_values($args));

It turns out that ... is a new operator introduced in PHP 5.6, which is also known as the Splat Operator.

Upgrading PHP version to 5.6 solved the problem. The lesson here is to always check the minimum system requirements before installation. The minimum systems requirements for Magento 2.1 can be found here.

Leave a Reply

Your email address will not be published. Required fields are marked *