php-phantomjs
php-phantomjs copied to clipboard
Declaration of ServiceContainer::load() should be compatible with Container::load($file)
I got this error on fresh install
Just stumbled upon this error myself. This has actually been corrected in the most recent release.
The problem is likely that you don't have the php bz2
extension configured on your server, which was been added as a dependency in v4.6. The result is that composer finds the latest compatible release (4.5.1) and installs that instead. This bug is still present there.
Installing the bz2 extension should solve your problems.
Same error. bz2 extension installed
PHP Warning: Declaration of JonnyW\PhantomJs\DependencyInjection\ServiceContainer::load() should be compatible with Symfony\Component\DependencyInjection\Container::load($file) in /home/develop/parsers/manyvids-parser/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/DependencyInjection/ServiceContainer.php on line 20 PHP Stack trace: PHP 1. {main}() /home/develop/parsers/manyvids-parser/crawler.php:0 PHP 2. JonnyW\PhantomJs\Client::getInstance() /home/develop/parsers/manyvids-parser/crawler.php:8 PHP 3. spl_autoload_call() /home/develop/parsers/manyvids-parser/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Client.php:102 PHP 4. Composer\Autoload\ClassLoader->loadClass() /home/develop/parsers/manyvids-parser/vendor/jonnyw/php-phantomjs/src/JonnyW/PhantomJs/Client.php:102 PHP 5. Composer\Autoload\includeFile() /home/develop/parsers/manyvids-parser/vendor/composer/ClassLoader.php:322 PHP 6. include() /home/develop/parsers/manyvids-parser/vendor/composer/ClassLoader.php:444
It sounds either way that one of the dependencies required to run v4.6 is not satisfied. In your composer.json file you could try fixing the version number eg "jonnyw/php-phantomjs": "4.6"
and then running composer update
. If v4.6 cannot be installed, the reason will be flagged.
听起来这两种方式都不满足运行v4.6所需的依赖项之一。在您的composer.json文件中,您可以尝试修复版本号,例如
"jonnyw/php-phantomjs": "4.6"
,然后运行composer update
。如果无法安装v4.6,则会标出原因。
PHP Warning: Declaration of JonnyW\PhantomJs\DependencyInjection\ServiceContainer::load() should be compatible with Symfony\Component\DependencyInjection\Container::load($file) in D:\wamp\www\wcphp\vendor\jonnyw\php-phantomjs\src\JonnyW\PhantomJs\DependencyInjection\ServiceContainer.php on line 20
Warning: Declaration of JonnyW\PhantomJs\DependencyInjection\ServiceContainer::load() should be compatible with Symfony\Component\DependencyInjection\Container::load($file) in D:\wamp\www\wcphp\vendor\jonnyw\php-phantomjs\src\JonnyW\PhantomJs\DependencyInjection\ServiceContainer.php on line 20