I'm trying a php script that is doing requests with CURL.
But I get the error Couldn't resolve host 'example.com'
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER , true);
curl_setopt($ch, CURLOPT_URL, 'https://example.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec( $ch );
if($result === false)
{
echo 'Error Curl : ' . curl_error($ch);
}
else
{
echo 'OK';
}
So I started to search the problem, I tried to do requests from my server with ping, curl (CLI) and telnet (that use libc6 like curl apparently) nslookup works fine too
Everything work fine.
So where is the problem ?
Thanks for the help
- Debian Wheezy
- libc6 2.19-18
- PHP 5.6.8-1 (with php-fpm)
- nginx