Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3602546
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:45:35+00:00 2026-05-18T20:45:35+00:00

I am on my new dedicated server and i am gettin error on curl

  • 0

I am on my new dedicated server and i am gettin error on curl connections.

I tried that one

$_h = curl_init(); 
curl_setopt($_h, CURLOPT_HEADER, 1); 
curl_setopt($_h, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($_h, CURLOPT_HTTPGET, 1); 
curl_setopt($_h, CURLOPT_URL, 'http://api.beatport.com/catalog/labels/detail?id=14248&format=json&v=1.0' ); 
curl_setopt($_h, CURLOPT_DNS_USE_GLOBAL_CACHE, false ); 
curl_setopt($_h, CURLOPT_DNS_CACHE_TIMEOUT, 2 ); 
var_dump(curl_exec($_h)); 
var_dump(curl_getinfo($_h)); 
var_dump(curl_error($_h)); 

and i got

bool(false) array(21) { ["url"]=> string(72) "http://api.beatport.com/catalog/labels/detail?id=14248&format=json&v=1.0" ["content_type"]=> NULL ["http_code"]=> int(0) ["header_size"]=> int(0) ["request_size"]=> int(0) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(0) ["namelookup_time"]=> float(0) ["connect_time"]=> float(0) ["pretransfer_time"]=> float(0) ["size_upload"]=> float(0) ["size_download"]=> float(0) ["speed_download"]=> float(0) ["speed_upload"]=> float(0) ["download_content_length"]=> float(-1) ["upload_content_length"]=> float(-1) ["starttransfer_time"]=> float(0) ["redirect_time"]=> float(0) ["certinfo"]=> array(0) { } } string(40) "Couldn't resolve host 'api.beatport.com'"

that may be a DNS issue ?

SOLVED:

i opened /etc/hosts and added the ip of the website that i want to retrieve via curl and it worked !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:45:36+00:00Added an answer on May 18, 2026 at 8:45 pm

    Your code is OK. This is actually an DNS configuration problem on the dedicated server. Check that your hosting service permits outgoing curl connections.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error log in my new dedicated server. PHP Startup: Unable
we have a old and dying dedicated server. we want a new one at
I need to run/develop a mono-based application on a new dedicated server, and the
I have a dedicated server and I'm in need for building new version of
I just got a new windows server 2008 dedicated server and I can't for
I'm trying to configure a dedicated server that runs ASP.NET to send mail through
I am going to install Debian on our new dedicated server and I have
I have just installed phpMyAdmin on my new Fedora Core 10 dedicated server. I
Background: I ran a security check on a dedicated server (linux) that I now
I run a server that is getting killed by the number of requests it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.