jonnnnyw / php-phantomjs

Execute PhantomJS commands through PHP
MIT License
1.44k stars 433 forks source link

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

Open djanym opened 6 years ago

djanym commented 6 years ago

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

jan-demsar commented 6 years ago

+1

jan-demsar commented 6 years ago

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! :)