php-phantomjs icon indicating copy to clipboard operation
php-phantomjs copied to clipboard

Warning: Declaration of ServiceContainer::load() should be compatible with Symfony...

Open djanym opened this issue 7 years ago • 2 comments

On some of my server a have this error: Warning: Declaration of JonnyW\PhantomJs\DependencyInjection\ServiceContainer::load() should be compatible with Symfony\Component\DependencyInjection\Container::load($file) in /var/www/html/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/DependencyInjection/ServiceContainer.php on line 20

PHP version: 7.2

djanym avatar Jul 26 '18 21:07 djanym

+1

jan-demsar avatar Sep 17 '18 13:09 jan-demsar

Ok I Solved it.

My Vagrant installation was missing php7.2-bz2 package, but I did not notice it until I changed line in my composer.json file from:

"jonnyw/php-phantomjs": "4.*",

to

"jonnyw/php-phantomjs": "^4.6.1",

because up until that point composer was installing ver 4.5.1 for me, but after that it started throwing the following error:

Problem 1 - jakoch/phantomjs-installer 2.1.1-p08 requires ext-bz2 * -> the requested PHP extension bz2 is missing from your system. - jonnyw/php-phantomjs v4.6.1 requires jakoch/phantomjs-installer 2.1.1-p08 -> satisfiable by jakoch/phantomjs-installer[2.1.1-p08]. - Installation request for jonnyw/php-phantomjs ^4.6.1 -> satisfiable by jonnyw/php-phantomjs[v4.6.1].

So all I had to do was run the following command:

sudo apt-get install php7.2-bz2

and then

composer update

And now it is working without a problem! :)

jan-demsar avatar Sep 17 '18 14:09 jan-demsar