You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this error when curl session failed on PHP 8.
Error: Object of class CurlHandle could not be converted to string in /srv/app/vendor/lokielse/aliyun-open-api-sls/src/Requests/RequestCore.php:664
Stack trace:
#0 /srv/app/vendor/lokielse/aliyun-open-api-sls/src/Client.php(355): Aliyun\SLS\Requests\RequestCore->send_request()#1 /srv/app/vendor/lokielse/aliyun-open-api-sls/src/Client.php(311): Aliyun\SLS\Client->getHttpResponse()#2 /srv/app/vendor/lokielse/aliyun-open-api-sls/src/Client.php(289): Aliyun\SLS\Client->sendRequest()#3 /srv/app/vendor/lokielse/aliyun-open-api-sls/src/Client.php(231): Aliyun\SLS\Client->send()
After some debugs, this is because you try to parse the CurlHandle object to string directly. Check this out:
It works on PHP 5 through 7, but doesn't work on PHP 8 and caused a parsing error. So I make this PR #4 to update it.
Anyway, in case you still wanna use some info from your CurlHandle object for the exception message, consider using curl_getinfo. Based on PHP Doc, it comply with PHP 4 >= 4.0.4, PHP 5, PHP 7, and PHP 8.
The text was updated successfully, but these errors were encountered:
AdiPP
changed the title
Object of class CurlHandle could not be converted to string on php 8.*
Object of class CurlHandle could not be converted to string on php 8
Aug 7, 2022
I got this error when
curl
session failed on PHP 8.After some debugs, this is because you try to parse the CurlHandle object to string directly. Check this out:
It works on PHP 5 through 7, but doesn't work on PHP 8 and caused a parsing error. So I make this PR #4 to update it.
Anyway, in case you still wanna use some info from your CurlHandle object for the exception message, consider using
curl_getinfo
. Based on PHP Doc, it comply with PHP 4 >= 4.0.4, PHP 5, PHP 7, and PHP 8.The text was updated successfully, but these errors were encountered: