paliarush / magento2-vagrant-for-developers

Vagrant Box for Magento 2 Developers
MIT License
447 stars 165 forks source link

Magento installation failed [/vagrant/scripts/guest/m-reinstall] #206

Open efmitchell opened 6 years ago

efmitchell commented 6 years ago

Mac OS 10.13.1, all listed requirements installed.

Whilst running init_project, get the error:

 Magento installation failed. [/vagrant/scripts/guest/m-reinstall]
[2018-10-07 11:11:36] >  PHP Parse error:  syntax error, unexpected '?', expecting variable (T_VARIABLE) in /Users/elliotmitchell/Code/vagrant-magento/magento2ce/lib/internal/Magento/Framework/Filesystem/Directory/Write.php on line

When I run with error logging I also get the below in the m-reinstall log:

`2018-10-07 12:11:33] STATUS: Deleting TestModule directories [/Users/elliotmitchell/Code/vagrant-magento/scripts/host/m_reinstall.sh]] [2018-10-07 11:11:35] STATUS: Killing MQ processes [/vagrant/scripts/guest/m-reinstall]] [2018-10-07 11:11:35] STATUS: Installing/re-installing Magento [/vagrant/scripts/guest/m-reinstall]] [2018-10-07 11:11:35] STATUS: > Removing Magento configuration files (env.php and config.php) [/vagrant/scripts/guest/m-reinstall]] [2018-10-07 11:11:35] STATUS: > Clearing Magento cache [/vagrant/scripts/guest/m-clear-cache]] [2018-10-07 11:11:35] STATUS: > Clearing directories containing temporary files [/vagrant/scripts/guest/m-clear-cache]] [2018-10-07 11:11:35] STATUS: > Dropping and creating 'magento' DB [/vagrant/scripts/guest/m-reinstall]] [2018-10-07 11:11:35] STATUS: > Dropping and creating 'magento_integration_tests' DB [/vagrant/scripts/guest/m-reinstall]] [2018-10-07 11:11:35] STATUS: > ./bin/magento setup:install --db-host=localhost --db-name=magento --db-user=root --backend-frontname=admin --base-url=http://magento2.vagrant220/ --language=en_US --timezone=America/Chicago --currency=USD --admin-lastname=Admin --admin-firstname=Admin --admin-email=admin@example.com --admin-user=admin --admin-password=123123q --cleanup-database --use-rewrites=1 --amqp-host=localhost --amqp-port=5672 --amqp-user=guest --amqp-virtualhost=/ --amqp-password=guest [/vagrant/scripts/guest/m-reinstall]]

Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /Users/elliotmitchell/Code/vagrant-magento/magento2ce/lib/internal/Magento/Framework/Filesystem/Directory/Write.php on line 35 [2018-10-07 11:11:36] ERROR: > Magento installation failed. [/vagrant/scripts/guest/m-reinstall]] [2018-10-07 12:11:36] INFO: > See details in /Users/elliotmitchell/Code/vagrant-magento/log/m-reinstall.log. For debug output set debug:vagrant_project to 1 in etc/config.yaml [./m-reinstall]] [2018-10-07 12:11:36] ERROR: > ++ which bash

Phpstorm isn't running as yet.

elburro1887 commented 6 years ago

I'm also getting this error. This is due to the following line

https://github.com/magento/magento2/blob/80469a61e061abd0001c93497a6d92296b46496b/lib/internal/Magento/Framework/Filesystem/Directory/Write.php#L35

It uses a new feature called "nullable types", which was apparently introduced in PHP 7.1

The installer only installs PHP 7.0 by default, so you need to change this to PHP 7.1

https://github.com/paliarush/magento2-vagrant-for-developers#switch-between-php-versions