PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 5, 2022

[FIXED] Creating Symfony 5 skeleton entity - maker bundle not working

 February 05, 2022     composer-php, php, symfony     No comments   

Issue

I'm trying to run

make:entity

But I receive an error:

There are no commands defined in the "make" namespace

You may be looking for a command provided by the "MakerBundle" which is currently not installed. Try running "composer require symfony/maker-bundle --dev"

I follow that advise and install the bundle by doing:

composer require symfony/maker-bundle --dev

It installs successfully: enter image description here

And yet when I try to run make:entity I get exactly the same error:

enter image description here

There are no commands defined in the "make" namespace

You may be looking for a command provided by the "MakerBundle" which is currently not installed. Try running "composer require symfony/maker-bundle --dev"

What am I missing?


Solution

When you require a package using the --dev flag, the package will be installed as a development package.

These are packages that should not be enabled on production, when your application is actually deployed. They have to be installed on your development machine, and on your development machine only.

If you check your bundles.php file you'll see this line:

Symfony\Bundle\MakerBundle\MakerBundle::class    => ['dev' => true],

This ensures that the bundle is only enabled when your APP_ENV variable is set to dev.

Since you are running your application on production mode, the bundle is not enabled.

Just change your APP_ENV to dev so that the package is enabled, and you'll be able to run make commands.



Answered By - yivi
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing