Report this

What is the reason for this report?

PHP cUrl is displaying a web page insted server not found.

Posted on December 24, 2014

Can you understand this PHP program>>

<?php
function file_get_contents_curl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}

echo file_get_contents_curl('http:// 5w43242423424v2ic.com');
?>

This program Should be echo ‘default server not found’ instead a web page.

digitalocean server is displaying a website page when i access this domain ‘http:// 5w43242423424v2ic.com’ via your server.

Because this domain is not available and registered.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @RinkuY:

Yes i solved this issues.

You can add “search domain.tld” line to the file /etc/resolvconf/resolv.conf.d/head which is used to generate the resolv.conf file on the system during reboot. AFTER that reboot droplet.

View the original comment

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.