简体   繁体   中英

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!

如果有人遇到此问题,则意味着您的php版本不是7.0。我遇到的问题是Mamp版本为7.1.1,symfony项目也在浏览器中的7.1.1上运行,但是当我检查php版本时bash命令,它是5.6,所以请确保您使用的是bash命令,使用php 7.0而不是5.6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM