Tripodkid Posted April 20, 2023 Share Posted April 20, 2023 Hi there! I’m building a WordPress site which connects to remote server to populate iframes on various pages of my site. My site connects to the remote server using a PHP code snippet. The code was working but now $curl stopped working and echos Resource id #34. I am not aware of any changes to my site and I have tried identifying the culprit by deactivating my plugins without success. Furthermore, my webhost doesn’t seem to have much of an idea about the cause and there doesn’t seem to be much info on the web. var_export($response); returns "false" var_export($err); returns '' Any help would be really appreciated! Thanks in advance! My code is below: $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.domo.com/oauth/token? grant_type=client_credentials&scope=data%20user%20dashboard", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_POSTFIELDS => "", CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_USERPWD => "$clientid:$secret" )); $response = curl_exec($curl); $err = curl_error($curl); var_export($response); var_export($err); curl_close($curl); Quote Link to comment https://forums.phpfreaks.com/topic/316166-wordpress-curl-and-resource-id-34/ Share on other sites More sharing options...
requinix Posted April 20, 2023 Share Posted April 20, 2023 "Resource id #X" means you have code that is trying to echo a resource - that's a type of value, like strings and integers and arrays are. Two things: 1. Code doesn't just randomly start behaving differently. What changed recently? 2. "Resource id #34" has to be coming from somewhere. If it's not those two var_exports then where is it? Quote Link to comment https://forums.phpfreaks.com/topic/316166-wordpress-curl-and-resource-id-34/#findComment-1607546 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.