symfony make:entity crash on new project
Asked Answered
P

1

5

Whenever I try to create an entity with bin/console make:entity, I get the following result:

php bin/console make:entity

 Class name of the entity to create or update (e.g. FierceElephant):
 > Video


In DebugClassLoader.php line 337:

  Warning: include(/home/user/work/project1/vendor/composer/../../src/Entity/Video.php): failed to open stream: No such file or directory  

This project is very new and there is very few code at the moment; It's the first entity I try to create in the project. I don't get why I get this since it's obvious that the file does not exist since I want to create it... I haven't found similar problem on google. Maybe I forgot to activate a php extension?

Any idea?

Puritanical answered 14/6, 2020 at 9:55 Comment(5)
Could be directory permissions and it can't write the file, so it's failing silently then when it tries to open it it doesn't exist. Seems like it would throw an error for failing to create but I don't have the code infront of me to checkBorders
didn't think of that, but I've checked and everything is with the same user I'm using, and in 775 so I guess the reason is elsewhere...Puritanical
Does the /home/user/work/project1/src/Entity directory exists?Cayla
Tried with sudo ?Uella
Try composer install (reinstall)Leper
S
27

Might need to composer dump-autoload if you've messed up and removed some classes by hand.

Stansbury answered 22/6, 2020 at 23:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.