I am using a linux system and curl is installed already in my system. When I check curl version in terminal curl --version then output is below
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
When I use this code in my application
var_dump(extension_loaded('curl'));
Output shows bool(false)
Even when I send some test data
$url = "my_url/?text=Test Data";
//$url = "www.google.com";
sendDataToUrl($url);
And my function is
function sendDataToUrl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT,1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
This function is not working. But same function is working in another linux server. I don't know what actual root cause and why don't working send data function?
Please help me to identify the root cause