chrome: chrome: command not found

Hi guys,

Got chrome installed on my local env which is OSX running php 7.2. I’ve got chrome installed with an aliase to the following

alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" chrome version is "Google Chrome 66.0.3359.117 "

but i Keep getting this stack trace

[2018-04-25 15:59:14] local.ERROR: Cannot get chrome version, make sure you provided the correct chrome binaries using (chrome). sh: chrome: command not found {"exception":"[object] (RuntimeException(code: 0): Cannot get chrome version, make sure you provided the correct chrome binaries using (chrome). sh: chrome: command not found at /Users/dansmacbook/projects/project-scrapper/vendor/chrome-php/chrome/src/BrowserFactory.php:78)

code execution is this

  $browser = $browserFactory->createBrowser([
                'headless'        => true,         
                'connectionDelay' => 0.8,           
                'debugLogger'     => 'php://stdout'
            ]);
        $page = $browser->createPage();
        $response = $page->navigate($url)->waitForNavigation();
        $browser->close();
        dd($response);

any thoughts on how to resolve this?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

In the interim can you try to use non aliased executable for chrome?

$browserFactory = new BrowserFactory("/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome");

I guess there is something related to OSX here. Let me do some checks.

As for the errors you get when starting headless I’m not sure they are fatale. I’m also getting errors message times to times when I start headless but it still works. They are more warning I think.