Stichoza / google-translate-php

🔤 Free Google Translate API PHP Package. Translates totally free of charge.
MIT License
1.79k stars 380 forks source link

ErrorException: Maximum execution time of 60 seconds exceeded #189

Closed qb-quotebook closed 1 year ago

qb-quotebook commented 1 year ago

Please help me how to fix the problem I'm getting

ErrorException Maximum execution time of 60 seconds exceeded

VENDORPATH\guzzlehttp\guzzle\src\Handler\CurlFactory.php at line 563

556                 throw new \InvalidArgumentException('on_headers must be callable');
557             }
558         } else {
559             $onHeaders = null;
560         }
561 
562         return static function ($ch, $h) use (
563             $onHeaders,
564             $easy,
565             &$startingResponse
566         ) {
567             $value = \trim($h);
568             if ($value === '') {
569                 $startingResponse = true;
570                 try {
Stichoza commented 1 year ago

Can you provide which URL is being called by the Guzzle code fragment you pasted?

e4digitalstudio commented 1 year ago

I'm also getting this issue I did all watiching this tut https://www.itsolutionstuff.com/post/how-to-use-google-translator-in-laravelexample.html ad also your installation but get same issue on localhost is this probelm of localhost or what please answer me asap

Symfony\Component\ErrorHandler\Error\FatalError Maximum execution time of 60 seconds exceeded http://localhost:8000/lang/change?_token=EsMNsiNDJ170OuFNPA0HqbFmO4SloOsLMzYOCVbK&lang=th image

Stichoza commented 1 year ago

The mentioned article has some bad examples of usage like translating static strings on each page load, etc. I know it's just for an example but translating that much strings on each page will obviously hit the execution limit.

Can you provide your code to better understand the situation? I think the issue is with number of API calls made on each request/run.

joe820912boy commented 1 year ago

The maximum length of string I think about 5000 characters in my used experience