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

  • Posted on December 24, 2014
  • RinkuYAsked by Rinku Y

Can you understand this PHP program>>

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);
return $data;

echo file_get_contents_curl('http://');

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://’ via your server.

Because this domain is not available and registered.

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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