Fail to create a controller file with make command in Symfony - symfony

I'm learning Symfony now and I ran into a problem trying to create a controller file with the make command. The path of the project is "E:\web_dev\testproject". When I ran the command
php bin/console make:controller
and then entered the name of the controller, it returns an error "Failed to create "E:\web_dev\testproject//E:\web_dev\testproject\vendor\composer/../../src/Controller"". What is the problem?

I have the same problem.
I have found this Thread and it seems that the problem is in the Maker Bundle. After running "composer remove maker" and "composer require maker 1.0.2" it works by me.
In the other Thread they used Maker Version 1.0.0 but in Symfony4 the generated AbstactController do not Functionaly so I use Version 1.0.2.
Hope it help you.

Related

Symfony 5 fast track book bug when migrating databases

This is my first step to symfony world, and I follow tutorial from Symfony fast track book. By executing the command below, my migration failed:
symfony new --version=5.0-3 --book guestbook --debug
Everything is OK expect "Migrating the database", this is the error:
Or symfony book:check-requirements says everything is OK.
For information: pdo_pgsql is already enabled in php.ini
Any trick to solve this issue?
I have moved to PHP 7.3.12 version to solve my issue.
By staying with PHP 7.4.0 version, you cannot add property when you execute the command: php bin/console make:entity MyEntity
I started Potencier's book two days ago. I faced several problems, which I have been able to solve, but I did not find this problem. I think you should give us more information. For example: What hardware are you using? What operating system? Where did the command giving the error run from? Did you run the command from Symfony CLI?

impossible to generate bundle

i'm new to the symfony framework and i'm trying to generate my first bundle ,
i use this command php bin/console generate:bundle but it's not working.
The error message :
There are no commands defined in the "generate" namespace.
You may be looking for a command provided by the SensioGeneratorBundle which is currently not installed.
Try running composer require sensio/generator-bundle.
https://imgur.com/csryfHZ
I've tried to install composer repositories with the command composer require sensio/generator-bundle and nothing has changed
In symfony 4, this bundle is deprecated, you must use the maker-bundle, unfortunately there is no bundle generator available. So you'll need to code your bundle from scratch with the official documentation: https://symfony.com/doc/current/bundles/best_practices.html
By the way, bundle are deprecated and are now only use to share packaged code between projects.
More informations at: https://symfony.com/doc/current/bundles.html
We're not making bundle in Symfony 4.
While it was "good practice" withg Symfony 2, since the new skeleton, it's not the case anymore.
Your default bundle is now App, all your code goes in src/, and all your view (twig files) goes in template/

symfony plugin install namespace error

I created a new symfony 2 project using 2.7. When I try to install a plugin using command line "symfony plugin:install sfFormExtraPlugin", I got an error:
"[InvalidArgumentException]
There are no commands defined in the "plugin" namespace.".
When I type "symfony list", I got "
Available commands:
about Symfony Installer Help.
demo Creates a demo Symfony project.
help Displays help for a command
list Lists commands
new Creates a new Symfony project.
self-update Update the installer to the latest version.
selfupdate Update the installer to the latest version.
". no plugin or other command like "cache" etc. What should I do? Thanks!
sfFormExtraPlugin is a plugin for Symfony 1 and won’t work with Symfony 2.*
Also, the symfony command line tool in Symfony 2 is not meant for application commands anymore but for creating new projects/installing Symfony. The new command line tool for application commands is app/console (which you use like php app/console something:something.)
But even then, this command isn’t used for managing dependencies (like plugins) anymore. We use composer for that instead. That’s a powerful package manager for PHP that can install and update the packages you require and also make sure that they are compatible. And it is not limited to the Symfony world.

Symfony in wamp error: Could not open input file: ⌠E:\wamp\bin\php\php5.5.12\symfony÷

I just installed symfony in my wamp according to the tutorials in below websites
http://uniapple.net/blog/?p=298
http://uniapple.net/blog/?p=298
all had finished without any error. But after finished all, when give the command symfony in cmd, it shows the below error.
Could not open input file: ⌠E:\wamp\bin\php\php5.5.12\symfony÷
and i couldn't figure it out. Please help..
Thank u in advance
If you are trying to use the Symfony console, you need to be in CMD and go to your project root:
cd C:\Sites\project
Before you try any commands, please make sure PHP is in your PATH variable.
Then to do commands in symfony you need to do:
php app/console command:action
//for example, do a cache warmup - choose your environment
php app/console cache:warmup --env=[dev|prod]
Is this what you mean when you want to use Symfony in cmd?

Add PHPStorm command line for symfony framework

I am new with symfony framework. I use PHPStorm, and I am going to set up its commandline for Symfony. However, anytime I do the steps, I receive an error :
Failed to load commands: Failed to execute php.exe c:\xampp\htdocs..\app\console-v
. Would you please give me guidance to solve this problem? Thanks
Firstly look at your current directory at command line.
secondly check to see if your path is true or not.

Resources