I have docker image
FROM php:8.0.2-fpm-buster
in composer
"symfony/panther": "^2.0",
"require-dev": {
"dbrekelmans/bdi": "^1.0",
i run
composer require --dev dbrekelmans/bdi && vendor/bin/bdi
inside container i have
root@c2392b7b5478:/usr/src/app# chromium -version
Chromium 90.0.4430.212 built on Debian 10.9, running on Debian 10.8
root@c2392b7b5478:/usr/src/app# google-chrome-stable -version
Google Chrome 106.0.5249.103
but
$httpClient = \Symfony\Component\Panther\Client::createChromeClient();
give my
RuntimeException {#1085 ▼
#message: ""chromedriver" binary not found. Install it using the package manager of your operating system or by running "composer require --dev dbrekelmans/bdi && vendor/b ▶"
UPDATE 1 I download
https://chromedriver.storage.googleapis.com/index.html?path=106.0.5249.61/
for my chrome
root@e752debb2a72:/usr/src/app# google-chrome -version
Google Chrome 106.0.5249.103
run
$httpClient = \Symfony\Component\Panther\Client::createChromeClient(
$this->kernel->getProjectDir().'/bin/chromedriver'
);
get error
Facebook\WebDriver\Exception\UnknownErrorException {#988 ▼
-results: array:1 [▼
"value" => array:3 [▼
"error" => "unknown error"
"message" => """
unknown error: Chrome failed to start: crashed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
"""
CodePudding user response:
You have to put chromedriver manually to your image: https://chromedriver.chromium.org/downloads
CodePudding user response:
Ok I add
$httpClient = \Symfony\Component\Panther\Client::createChromeClient(
$this->kernel->getProjectDir().'/bin/chromedriver',[
'--remote-debugging-port=9222',
'--no-sandbox',
'--disable-dev-shm-usage',
'--headless'
]
);
now work fine