1

I am currently using Symfony 4 and while I am trying to create a user login form for my app, I use the command Composer require security and I get this error:

Parse error: parse error in /Applications/MAMP/htdocs/myapp/vendor/symfony/flex/src/Flex.php on line 275

The culprit is in the symfony flex file Flex.php

$installContribs = $this->composer->getPackage()->getExtra()['symfony']['allow-contrib'] ?? false;

I then found I cannot use any Composer commands, such as composer update, composer require, and so on. Any help would be appreciated!

  • 1
    Which PHP version are you running? That's a change which arrived with PHP 7 – Nico Haase Apr 03 '18 at 07:53
  • Flex need php7 and up. if you use `--ignore-platform-reqs` it will not break with an usefull error message. https://github.com/symfony/flex/blob/master/composer.json#L12 – Rufinus Apr 04 '18 at 08:56
  • I have php 7 on my mac but I think I might have only installed it locally in some projects so it might be looking for php 7 at the root, which I think is still 5.6.3. That is probably it though, Ill fix my php and try again! – Patrick Connelly Apr 04 '18 at 15:36

0 Answers0