I am using curl to request another site for getting data. My code having curl_reset()
funciton is working well at localhost, but when i have updated my code to server. Its giving error
Fatal error: Call to undefined function curl_reset() in /data/html/reviewkiller1.0/controller/searchController.php on line 2054
Note: I have checked for curl extension it is enabled.
Why it is so???
Requires no PHP version updating.
if (!function_exists('curl_reset'))
{
function curl_reset(&$ch)
{
$ch = curl_init();
}
}
PHP is old on your server.
From the manual: (PHP 5 >= 5.5.0)
My PHP version is 5.3 so i was not able to use curl_reset()
function.
I was using curl_reset()
function for getting response of multiple curl request.
So i have removed curl_reset()
and used
curl_setopt($curl_handle, CURLOPT_HTTPGET, 1);
curl_setopt($curl_handle, CURLOPT_POST, false);
Problem was after post request my get request was not giving response when i have set curl_post to false to my request it works well.
Conclusion: Its important keep calling setopt to switch between GET and POST request when you are using multiple curl request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With