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

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/

Related

Facing issue installing pug-php/pug-symfony on Symfony 2.8.26

I am facing an issue while installing pug-php/pug-symfony in Symfony 2.8.
I started with a fresh symfony installation and executed
composer require pug-php/pug-symfony
All the dependencies were fetched and downloaded and tyhe composer.json also got updated, however in the step of autoloader.php generation, it comes up with this error. (below image)
autoload.php issue when installing pug on symfony
To debug the issue, i tried executing
composer dump-autoload -o
and the same error pops up again.
Next, I tried something cheeky and created a new blank autoload.php file in the Symfony project directory root, and again executed composer update and composer dump-autoload, however, this time am getting this,
composer update issue (2)
Please help.
Your path is wrong currently it is stating that there is no autoload.php file in the directory C:\xampp\htdocs\demoSymfony\autoload.php. There should be a vendor directory where the autoload.php file is found. Can you update your question with the current Repository structure/hierarchy? That will probably give us more info to help you.
Straight from their docs: For libraries that specify autoload information, Composer generates a vendor/autoload.php file. You can simply include this file and start using the classes that those libraries provide without any extra work
https://getcomposer.org/doc/01-basic-usage.md#autoloading
We have solved this issue, you should now be able to install it with no such problem by following the README install process:
https://github.com/pug-php/pug-symfony#pug-symfony

PHP Composer does not clone symfony/assetic-bundle properly

I am trying to install Symfony on CentOS Linux wih PHP 5.6 and cPanel installed.
When I run composer require symfony/assetic-bundle , once adding bundle to the AppKernelphp, symfony (app/console too) stops working and keeps logging this error:
[10-Jun-2016 22:00:57 UTC] PHP Fatal error: Class 'Symfony\Bundle\AsseticBundle\AsseticBundle' not found in /home/avid24/public_html/app/AppKernel.php on line 19
After checking the vendor directory, turns out that composer has downloaded a single compressed file with a random name, I could extract it with unzip. but problem still exists!
This environment works properly on windows and I could easily update symfony and its components using composer.
Any help? Anyone with the same experience ?
Well, I eventually figured out the problem!
I enabled suhosin extension which prevents the composer and other similar command prompt php scripts from a proper execution.
As a temporary solution I copied php.ini and disabled unnecessary extensions and put it next to my project and call composer this way
$php -c ../composer-php.ini ~/composer ......
I'll create a script to make the life easier
I didn't find any resource which describes coexistence of composer and suhosin extension, so I'm not sure if this is the ultimate solution but the root cause is identified.
If anybody makes workaround this subject I'd be more than happy to know about it.

PHP framework AMPHP/THREAD used with SYMFONY - Where does it have to be installed?

I am looking to implement the framework amphp/thread, with Symfony3, which I ve read about in this article (https://www.mullie.eu/parallel-processing-multi-tasking-php/).
I'd looked at the setting process on the git page: https://github.com/amphp/thread.
I've followed the checklist:
PHP5.5+ = OK Php 5.5.12
pecl/pthread = OK I did install it as explained on Windows8
Now, 3rd task on the checklist, I have the installation of the framework itself (amphp/thread) left to do.
I am a bit confuse, because it is not an "official" Symfony bundle. So I don't think I can put it under [my_symfony_project]/vendor/ and refer to it in the file [my_symfony_project]/app/AppKernel.php. So how do one do in this case:
Do one put the directory of the library under the root directory [my_symfony_project]?
And afterwards, how can one refer to it in the Symphony class/file, should I write: "use amphp/thread" between the namespace declaration of my Symfony file and the class code itself?
You can simply install the library with composer, as example launching this command from the root of your project:
>php composer.phar require amphp/thread
And use it in your code directly: the composer process generate the correct autoloader for you. No necessary add to the list of the Symfony2 bundle (is not a bundle).
Hope this help
You will need to install the package by adding the following to your composer.json file:
"require": {
"amphp/thread": "0.8.1"
}
Then run "composer install" on your server.

Installing Yii2: Invalid Parameter – yii\base\InvalidParamException

I'm installing Yii2 in the way that shows the Getting Started tutorial:
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
When I try to access localhost/YiiTutorial/basic/web I get this error:
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: C:\wamp\www\YiiTutorial\basic\vendor\bower/jquery/dist
In the tutorial says that is nothing to edit... it should work right out of the box... what I'm missing?
If I download the package and place it in the same folder, it works perfect, but I want to install it from composer!
Inside vendor/bower folder it's another one called bower-asset.
Copy this folder content (some other folders named bootstrap, jquery, etc...) and move them to vender/bower.
it a recent bug. update your fxp plugin to latest version (1.1.1) and clear composer's cache and try :
composer self-update
composer global update
composer update
Mainly if not issue regarding to vendor installation so please give permission to your /assets and /runtime folers of your projects and try to run again.
In your vendor folder you should rename bower-asset to bower .
OR you can use the following
make sure that you have the following in your composer.json:
composer.json
Other ways
I have encountered this kind of problem lately, the issue is in your composer it missing the asset-plugins which allows managing bower and npm package dependencies through Composer. Just run this command, you only need to run this command once for all. You can read the yii2 docs. Yii2 Installation
composer global require "fxp/composer-asset-plugin:^1.2.0"

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.

Categories