New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chrome: command not found #9
Comments
Hi @agentmarine |
indeed it does dansmacbook$ chrome if i try it with chromium it does throw another error
|
@gsouf I've also attempted headless
|
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. |
In the interim can you try to use non aliased executable for chrome? $browserFactory = new BrowserFactory("/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"); |
Well that seems to have done the trick for the time being
|
I don't know much of this stuff on osx, but for some reasons it appears that your alias is not available in the php context. What file did you put your alias in? |
ran the command strait into terminal, even tried to sudo it. |
Ok, the command is started with symfony/process. My guess it's that it does not use the same session as the one you start php with. What if you add your alias in one of .bashrc, .bash_login or .profile? (source: https://stackoverflow.com/questions/8967843/how-do-i-create-a-bash-alias) |
Just went to check my .bash_profileit seems this already has this line
|
Was "CHROME_PATH" env variable added automatically or did you do it by yourself? If it's added here automatically then it could be great that the library tries to read this env variable before using the default "chrome" |
I cant say I added it as CHROME_PATH so i am guessing this was added automatically at some point. |
I just released version 0.1.1 that will look for CHROME_PATH env variable before using "chrome". |
Hey Gsouf, Tested it again this morning after updating.
|
Hi @agentmarine Can you please enable debug logger and send what it says? |
|
Ok I think that the reason it's that the path in you CHROME_PATH env does not contain the backslash before the spaces. I will check if it's an issue with the variable, or if php should be able to escape it. |
@agentmarine I think it should be all good with version 0.1.2 |
Yep thats fixed it @gsouf |
Great thank you. Just remember that if you migrate your code on a server that does not have the CHROME_PATH env variable set then it would not work. I'm closing the issue if you have further issues feel free to open a new ticket. |
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
any thoughts on how to resolve this?
The text was updated successfully, but these errors were encountered: