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!
Related
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
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/
I am new in symfony 3.0. I want to integrate ACL in my project.I am using following environment.
Symfony 3.0
OS: Windows
I did follow below link:
http://symfony.com/doc/current/cookbook/security/acl.html
When I run this command: php bin/console init:acl
I am getting following message:
[LogicException]
You must install symfony/security-acl in order to use the ACL functionality
Can anyone suggest how I can integrate it? Is there any demo URL and from where I can download the code?
You are missing a package that Symfony needs in order to activate ACL on your project.
To install such packages, you'll need to have a working Composer installation (Composer is a PHP dependency management scripts you can use to manage packages): see https://getcomposer.org/download/
Once Composer is running, you can open a console and go to the root of your project. There you can run the following command line option:
composer require symfony/security-acl
followed by:
composer update
Now you should be able to run the php bin/console init:acl command successfully.
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 :)
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