Stichoza / google-translate-php

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

cURL error 2: easy handle already used in multi handle #134

Closed hassan-k001 closed 4 years ago

hassan-k001 commented 4 years ago

cURL error 2: easy handle already used in multi handle (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) {"userId":1,"email":"admin@gmail.com","exception":"[object] (ErrorException(code: 0): cURL error 2: easy handle already used in multi handle (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /public_html/translator/vendor/stichoza/google-translate-php/src/Stichoza/GoogleTranslate/TranslateClient.php:318)

 public function translateText($string,$lang){
        if($string != null  && !is_int($string)){
            return TranslateClient::translate('en', $lang, $string);
        }
        return '';
    }

Working fine on localhost. but getting curl error on server after translating once.

php 7.0 , laravel 5.5

Stichoza commented 4 years ago

You're using outdated version of this package. Try v4

hassan-k001 commented 4 years ago

You're using outdated version of this package. Try v4

issue is resolved , however i am getting this error because of too many requests

Client error:GET https://translate.google.com/translate_a/single?client=webapp&hl=en&dt=t&dt=bd&dt=at&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&sl=en&tl=si&q=Under+foot&ie=UTF-8&oe=UTF-8&multires=1&otf=0&pc=1&trs=1&ssel=0&tsel=0&kc=1&tk=408044.2706resulted in a429 Too Many Requests``

i have google translate api credential json file for billable api. can i use that with this api ? what would be the procedure for that.

frzsombor commented 4 years ago

I'm sure you closed the issue, because you found the answer to the '429 Too Many Requests', but if not, or someone else is wondering, this is an often mentioned known limitation that you can read more about on the project's homepage.