Unable to execute "doctrine:fixtures:load" - symfony

I am running Symfony 2.8.7 on my local machine. I installed Data Fixtures using composer and I am not able to execute following command:
php app/console doctrine:fixtures:load
It tells me there are no commands defined in the "doctrine:fixtures" namespace. What am I doing wrong?

Related

Using bin/console gets AppFixtures::load error

Compile Error: Declaration of App\DataFixtures\AppFixtures::load(Doctrine\Common\Persistence\ObjectManager $manager) must be compatible with Doctrine\Common\DataFixtures\FixtureInterface:
:load(Doctrine\Persistence\ObjectManager $manager)
The above error is coming when I run composer install or bin/console (anything)
I have a working project but had to transfer to a new server. The main differences are apache version and php version (formerly 7.3.16 now 7.3.22)
I have tried:
*composer dump-autoload
*checked php dependancies
*confirmed .env settings
rm -rf vendor/ and reinstall
*dev and prod environments in .env
Yes, #indra you are right, since Doctrine 2.1.2 the Doctrine/Common was removed so any repos/fixtures using those failed. After updating them all in app, it worked.

Cron Bundle fail run bin/console on symfony 4

I'm trying to run a command through a cron job in a Symfony 4 app.
I have created my command and it run success when I run manually from the console (from my symfony root directory)
C:\xampp\htdocs\MY-PROJECT>php bin/console MY-COMMAND /*It works fine*/
I installed CronBundle (https://packagist.org/packages/cron/cron-bundle) and I registered a cron job from the console:
C:\xampp\htdocs\MY-PROJECT>php bin/console cron:create
The cron job was successfully create in the database, and I try to run:
C:\xampp\htdocs\MY-PROJECT>php bin/console cron:run"
time: 0.15687298774719
The cron job seems to run but it doesn't do anything (but the console show the time elapsed). The cron_report database table report the error => "Could not open input file: bin/console"
It seems that the cron bundle run the command from a different directory than the one I use when I run the command manually (the root directory of the project).
I tried to run from the console "php bin/console cron:start", but a error message is thrown => "This command needs the pcntl extension to run." I'm running xampp on windows
The PHP pcntl extension does not run on Windows.

Composer update error while trying to install ccdn-forum-bundle Symfony2

first of all I would like to say that I'm relatively new to symfony and I work with Netbeans.
My first problem occurs when I'm trying to install ccdn-forum-bundle like it's said here:
https://github.com/codeconsortium/CCDNForumForumBundle/blob/master/Resources/doc/install.md
When I try to update-dev with composer I get this error:
[RuntimeException]
Failed to execute git status --porcelain --untracked-files=no
"git" is not recognized as an internal or external command, operable program or batch file.
It occurs when composer is trying to update friendsofsymfony/user-bundle and when I try to run my project I get this error from symfony:
ClassNotFoundException: Attempted to load class "MonologBundle" from namespace "Symfony\Bundle\MonologBundle" in C:\xampp\htdocs\PortalInternoHUPR\app\AppKernel.php line 14. Do you need to "use" it from another namespace?
I tryed to fix it by running install dev in composer, but then I get this other one:
Fatal error: Class 'Knp\Bundle\PaginatorBundle\KnpPaginatorBundle' not found in C:\xampp\htdocs\MyProject\app\AppKernel.php on line 23
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command.
Thanks.
Try not to use netbeans, and install the bundle directly from the prompt
First check if git is correctly installed
git –version
Then run
php composer.phar update
If that didn’t work for you, I suggest making a fresh install using --prefer-dist option
php composer.phar install --prefer-dist

Change CLI's php

Im working with Symfony2. Im trying to execute the following command:
php app/console doctrine:database:create
The problem is that I get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20090626/apc.so' - dlopen(/opt/local/lib/php/extensions/no-debug-non-zts-20090626/apc.so, 9): image not found in Unknown on line 0
Could not create database for connection named <comment>symfony</comment>
could not find driver
APC is already installed, since the Symfony/web/config.php was OK, what I realised is that the version of php from CLI is different from the one Apache is running.
The one Apache is running has APC installed, so I would like CLI to run that same php, How can I do that?
in my case deleting the version that macports installed was enough to have CLI and Apache run the same PHP.
And that's:
sudo port uninstall php5

Symfony2 app/console --env throws no envirorment name

I'm working with symfony2 and while migrating from Beta2 version to the current one I messed up with some environment configuration.
My trouble here is when I run
php app/console --env
I get the following error
[InvalidArgumentException]
The file "MyWebRoute\symfony-standard\app/config/config_.yml" does not exist.
How should I get this working?
What should the proper configuration be?
That is b/c you have to specify your environment.
Available by default are "prod" and "dev".
So if you want to have console do something regarding your development environment you do
./console --env=dev [...]
The error message stems from console trying to load the appropriate configuration file, which is config_dev.yml for "dev" and config_prod.yml for "prod" and config_.yml for ""; but that one doesn't exist.

Resources