coder_1432
coder_1432

Reputation: 283

Symfony Command Line Parse Error

Good afternoon,

I'm working on a symfony project and everything was going well until I received the following messages :

PHP Warning: Unsupported declare 'strict_types' in .../vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 19

PHP Parse error: parse error, expecting ';'' or '{'' in .../vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 97

These 2 messages appear whenever I try to use the command line in symfony.

I tried the following commands:

php app/console generate:doctrine:entity 

and

php app/console cache:clear --env=prod.

I also tried to use php bin/console instead of app/console as I'm aware the new symfony versions use php bin/console.

I'm using Mamp with php version 7.1 and Symfony version 2.8 for the projects.

Thanks for your help!

Upvotes: 0

Views: 742

Answers (1)

coder_1432
coder_1432

Reputation: 283

If someone runs into this issue it means that your php version is not 7.0 The issue I had was that the Mamp version was 7.1.1 and the symfony project was also running on 7.1.1 in the browser but when I checked the php version in the bash commands, it was 5.6 so make sure you're bash commands use php 7.0 instead of 5.6

Upvotes: 1

Related Questions