Error Sonata Classification Bundle - php

I have installed Classification bundle and also install its depends bundle, I have configured all steps from http://sonata-project.org/bundles/classification/master/doc/index.html
But I have faced following error
PHP Fatal error: Class 'Application\Sonata\ClassificationBundle\SonataClassificationBundle' not found in myproject\app\AppKernel.php in line PHP Stack trace:
I have also registered this bundle in AppKernal and Application bundle found in src source directory, can anyone has idea about it?
Thanks

I think you forgot to run the following command:
php app/console sonata:easy-extends:generate --dest=src SonataClassificationBundle
This will generate a bundle in your Application folder as it is mentioned in the documentation here: http://sonata-project.org/bundles/classification/master/doc/reference/installation.html

Related

Symfony framework problem with creating controller

I just started to learn Symfony framework and I got stuck on very begging.
I created with composer with following commands:
composer require symfony/maker-bundle --dev
composer require annotations
php bin/console make:controller ToDoListController.php
Code looks good, but when I try to open this controller I am getting an error message:
Uncaught Error: Class 'Symfony\Bundle\FrameworkBundle\Controller\AbstractController' not found in C:\xampp\htdocs\symfony44\src\Controller\ToDoListController.php:9 Stack trace: #0 {main} thrown in C:\xampp\htdocs\symfony44\src\Controller\ToDoListController.php on line 9.
I am using xampp as a local server, symfony 4.4
Has anyone encountered with this problem?
Please install symfony using the symfony app. Download the app for windows from https://symfony.com/download.
Open the windows command prompt.
type the following commands
symfony new project-name --full
cd project-name
symfony serve
symfony serve starts your development server. Use apache when your app is deployed. With the symfony app you can use https. This method of symfony installation is easy and it is good for those new to symfony. With the --full option maker bundle and all other important bundles are installed for you. You can just start creating controllers

'Symfony\Component\HttpFoundation\Session\SessionBagInterface' not found

I am an end user of Drupal and I am trying to migrate my site (www.vagile.nl) from 8.1.x to 8.2.5. Now I am getting an HTTP 500 error, the phperror.txt says:
PHP Fatal error: Interface 'Symfony\Component\HttpFoundation\Session\SessionBagInterface' not found in D:\www\vagile.nl\www\vendor\symfony\http-foundation\Session\Storage\MetadataBag.php on line 24
When I look at the directory structure there is no directory in Symfony called Component. In the PHP file it says:
namespace Symfony\Component\HttpFoundation;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
Any ideas?
Thanks in advance!!
Cheers Tom.
It may not have been installed properly during the update. I am not a Drupal expert, but Symfony components are normally managed with Composer; if there is a composer.json or composer.lock file in your project, you may need to install dependencies with composer.
Have you tried a composer install? If you haven't got composer already, you can download it from https://getcomposer.org/

PHP Fatal error: Class 'Bllim\Datatables\DatatablesServiceProvider'

I'm a newbie in Laravel. I just cloned my co-worker git and try to php artisan list but it gives me error
PHP Fatal error: Class 'Bllim\Datatables\DatatablesServiceProvider' not found in /Users/path-to-project/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
I can't find any documentations about this error and search results don't really help.
Any of you ever met this problem and care to help me fix this? Thank you.
Asking your coworker would be a first good step :)
That said, the error you're getting indicates that PHP can't find or autoload a Laravel Service provider class. If your coworker is following Laravel best practices, you should be able to fix this by running the following command from your root project directory (or the directory with a composer.json file)
$ composer install
or ...
$ composer.phhar install
The format of the command (phar or no phar) will depend on how you've installed composer, the dependency/package manager used in Laravel.

PHPUnit with Symfony Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' not found

I'm trying to testing my app made with Symfony. I wrote a test and when I launch it, i get the following error:
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle'
not found in /.../app/AppKernel.php on line 17
I had the same error with Symfony's MonologBundle, AsseticBundle and SwiftmailerBundle: then I've manually added these bundles into my app, so pheraps I have fixed those errors, but with Doctrine I've not found any solutions yet.
It looks like maybe you did not install the Doctrine bundle.
Try to go to the root of your project where the composer.phar is located through a console, and try to run it like this:
php composer.phar
It will install all dependencies of Symfony2,and hopefully everything is going to work :)

Symfony2 + SonataPageBundle

I try to install SonataPageBundle on Symfony2, but I get an error during the bundle configuration...
I followed the Official Documentation for install the bundle and at the 3.3 step when I run the following command:
php app/console sonata:page:create-snapshots -site=all
I get this error:
Fatal error: Class 'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher' not found in /var/www/Symfony/app/cache/dev/appDevDebugProjectContainer.php on line 2631
Have you any idea about my problem?
You need to replace all the
Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
In the project to
Symfony\Bundle\FrameworkBundle\ContainerAwareEventDispatcher
I just did this and it worked!
You may use Symfony 2.0, and missing
Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
You can download package symfony 2.1 or master in https://github.com/symfony/symfony
Copy file ContainerAwareEventDispatcher.php in Symfony\Component\EventDispatcher folder in to your Symfony 2.0 (vendor\symfony\src\Symfony\Component\EventDispatcher)
I did it, worked fine!

Categories