PHP chrome-php / headless-chromium-php错误

huangapple go评论139阅读模式
英文:

PHP chrome-php / headless-chromium-php error

问题

抱歉,我无法理解代码部分,但以下是您要求的错误消息的翻译:

"Fatal error: Uncaught Wrench\Exception\HandshakeException: 握手响应中未接收到接受标头,位于 C:\Users\kamurj\vendor\chrome-php\wrench\src\Protocol\Protocol.php 的第 469 行
堆栈跟踪:
#0 C:\Users\kamurj\vendor\chrome-php\wrench\src\Client.php(243): Wrench\Protocol\Protocol->validateResponseHandshake('HTTP/1.1 403 Fo...', 'oMHZ8u72RCw63G9...')
#1 C:\Users\kamurj\vendor\chrome-php\chrome\src\Communication\Socket\Wrench.php(99): Wrench\Client->connect()
#2 C:\Users\kamurj\vendor\chrome-php\chrome\src\Communication\Connection.php(186): HeadlessChromium\Communication\Socket\Wrench->connect()
#3 C:\Users\kamurj\vendor\chrome-php\chrome\src\Browser\BrowserProcess.php(146): HeadlessChromium\Communication\Connection->connect()
#4 C:\Users\kamurj\vendor\chrome-php\chrome\src\BrowserFactory.php(81): HeadlessChromium\Browser\BrowserProcess->start('C:\Program File...', Array)
#5 C:\xampp\htdocs\zmeta.php(266): HeadlessChromium\BrowserFactory->createBrowser(Array)
#6 {main} thrown in C:\Users\kamurj\vendor\chrome-php\wrench\src\Protocol\Protocol.php on line 469"

英文:

I have been using the chrome-php & headless-chromium libraries for few months without any issues but now I get this error. Does anyone know why this would start happening? Thanks.

Fatal error: Uncaught Wrench\Exception\HandshakeException: No 
accept header receieved on handshake response in         
C:\Users\kamurj\vendor\chrome-php\wrench\src\Protocol\Protocol.php:469 
Stack trace: #0 C:\Users\kamurj\vendor\chrome- php\wrench\src\Client.php(243): Wrench\Protocol\Protocol- >validateResponseHandshake('HTTP/1.1 403 Fo...', 'oMHZ8u72RCw63G9...')                 
 #1 C:\Users\kamurj\vendor\chrome- php\chrome\src\Communication\Socket\Wrench.php(99): Wrench\Client- >connect() #2 C:\Users\kamurj\vendor\chrome- php\chrome\src\Communication\Connection.php(186): HeadlessChromium\Communication\Socket\Wrench->connect() #3 C:\Users\kamurj\vendor\chrome-php\chrome\src\Browser\BrowserProcess.php(146): HeadlessChromium\Communication\Connection->connect() #4 C:\Users\kamurj\vendor\chrome-php\chrome\src\BrowserFactory.php(81): HeadlessChromium\Browser\BrowserProcess->start('C:\\Program File...', Array) #5 C:\xampp\htdocs\zmeta.php(266): HeadlessChromium\BrowserFactory->createBrowser(Array) #6 {main} thrown in C:\Users\kamurj\vendor\chrome-php\wrench\src\Protocol\Protocol.php on line 469

答案1

得分: 5

I also just stumbled upon this issue. As @ottenhoff mentioned, downgrading to the earlier version works well.

For anybody else encountering this issue. Below are instruction on how to set a specific version for deb Ubuntu.

CHROME_VERSION=110.0.5481.96-1
wget --no-check-certificate https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
dpkg -i google-chrome-stable_${CHROME_VERSION}amd64.deb || apt -y -f install
rm google-chrome-stable
${CHROME_VERSION}_amd64.deb;

IF you are runnning this in a docker image use the below:

ENV CHROME_VERSION=110.0.5481.96-1
RUN curl -LO https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
RUN dpkg -i google-chrome-stable_${CHROME_VERSION}amd64.deb || apt -y -f install
RUN rm google-chrome-stable
${CHROME_VERSION}_amd64.deb;

I hope this helps...

英文:

I also just stumbled upon this issue. As @ottenhoff mentioned, downgrading to the earlier version works well.

For anybody else encountering this issue. Below are instruction on how to set a specific version for deb Ubuntu.

CHROME_VERSION=110.0.5481.96-1
wget --no-check-certificate https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb || apt -y -f install
rm google-chrome-stable_${CHROME_VERSION}_amd64.deb;

IF you are runnning this in a docker image use the below:

ENV CHROME_VERSION=110.0.5481.96-1
RUN curl -LO https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
RUN dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb || apt -y -f install
RUN rm google-chrome-stable_${CHROME_VERSION}_amd64.deb;

I hope this helps...

答案2

得分: 4

我遇到了相同的问题。通过降级 google-chrome-stable 来解决。

我当时使用的是 111.0.5563.64,降级到 110.0.5481.0 后问题解决。

英文:

I had the same issue. Fixed by downgrading google-chrome-stable.

I was at 111.0.5563.64 and downgraded to 110.0.5481.0 and it works again.

答案3

得分: 1

这个问题已经在chrome-php/chrome v1.8.1中得到解决。

https://github.com/chrome-php/wrench/issues/11

我今天升级了并验证它已修复。

英文:

You no longer need to downgrade Chrome. This issue has been resolved in chrome-php/chrome v1.8.1

https://github.com/chrome-php/wrench/issues/11

I upgraded today and verified it is fixed.

huangapple
  • 本文由 发表于 2023年3月9日 21:24:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75685227.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定