PHPとSeleniumを使ったクローラーを作っているのですが、タイトルの通りさくらVPS上で動かすと、Chrome failed to start: exited abnormallyというエラーが出て起動できず、どなたか解決方法を教えていただけないでしょうか。
■環境
サーバー:CentOS 7.5
Google Chrome:72.0
ChromeDriver:2.46
■ソースコード
PHP
1 $host = 'http://127.0.0.1:4444/wd/hub'; 2 $options = new ChromeOptions(); 3 $options->addArguments([ 4 '--disable-gpu', 5 '--disable-dev-shm-usage', 6 '--no-sandbox', 7 '--disable-extensions', 8 '--headless', 9 '--window-size=1280x1024' 10 ]); 11 $capabilities = DesiredCapabilities::chrome(); 12 $capabilities->setCapability(ChromeOptions::CAPABILITY, $options); 13 $driver = RemoteWebDriver::create($host, $capabilities); 14 $driver->get('https://www.google.co.jp/'); 15 $file = __DIR__ . '/' . __METHOD__ . "_chrome.png"; 16 $driver->takeScreenshot($file); 17 $driver->close();
■エラー内容
[Facebook\WebDriver\Exception\UnknownServerException]
unknown error: Chrome failed to start: exited abnormally
(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.)
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 3.10.0-862.6.3.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 130 milliseconds
もし情報に不足等ございましたら、そちらもお手数ですがご指摘いただけると助かります。
何卒、よろしくお願いいたします。
あなたの回答
tips
プレビュー