6

I am trying to install magento 2.3.0 on localhost i am getting following issue.

Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/html/m230/vendor/magento/framework/Filesystem/Directory/Write.php on line 35

4
  • Getting below error in installation 2.3.0 1st screen > Error: [$rootScope:infdig] > errors.angularjs.org/1.6.9/$rootScope/infdig? Commented Nov 29, 2018 at 9:59
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review Commented Nov 29, 2018 at 10:15
  • Can you please add your PHP version? Maybe watch this issue: github.com/magento/magento2/issues/17285 Commented Nov 29, 2018 at 11:40
  • Can you please let us know if you are trying to install it via composer or Web wizard? Commented Nov 29, 2018 at 11:51

6 Answers 6

4

Magento 2.3 is not supporting php version 7.0

it works with php 7.1 OR php 7.2. It fully supports php 7.2.

Please check your php version and upgrade it to php 7.2(recommended).

1

Check this official link https://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html

Check whether your system satisfies it's requirement as php 7.0 and php extensions.

In future mention which machine you are trying to deploy magento in your question description.

1

As mentioned in requirement doc https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

Magento v2.3.0 supports PHP v7.1.3+ so any version higher than this will resolve your issue.

I tested it with PHP v7.1.24 it works fine.

0
1

You can just use 'php72' instead the 'php' and there would be no issues.

php72

0

Please check this link After installing magento 2.3 admin login page cant open properly

Find : /vendor/magento/framework/View/Element/Template/File/Validator.php:139 find : foreach ($directories as $directory) { if (0 === strpos($realPath, $directory)) { return true; } } Replace with: foreach ($directories as $directory) { $realDirectory = $this->fileDriver->getRealPath($directory); // and replace `$directory` with `$realDirectory` if (0 === strpos($realPath, $realDirectory)) { return true; } } 
1
  • No it does not work. Commented Feb 12, 2019 at 6:32
0

Seems your magento version does not support your PHP version.

If you want to run it as 7.2 on ssh you should append the path to php 7.2 first and then php- command.

Open .htacess and add this line on the top of it SetEnv PHPRC /home/your directory/public_html/php.ini

So the system could know now php.ini path.

Now open CMD and execute any command with this /usr/local/bin/phpxx bin/magento c:c where XX should be your desired php version, for instance php72 or php71 etc

/usr/local/bin/phpxx bin/magento c:c this command clears the cache

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.