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

  • Home
  • SEARCH
  • 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 7668509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:22:55+00:00 2026-05-31T15:22:55+00:00

I have a problem working with curl_getinfo I have already checked the php.ini for

  • 0

I have a problem working with

curl_getinfo

I have already checked the php.ini for curl extension and everything seems to be fine and inside phpinfo();, curl is enable so I know that It shouldn’t have any problem.

This function runs fine in my web server. It is my local machine with XAMPP 1.7.7 that gives me a hard time. Could this be because of firwall settings of my laptop?

Please note that the jpg file exists inside the Amazon s3 URL and I have checked the Amazon URL on the browser and it shows the image…

/////////////////// Edited //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

here is my code which is a function or method inside a class:

public function pictureExistence($id){

    $url = AMAZON_S3_URL . $id . '.jpg';

    //var_dump($url);
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_exec($ch);
    //var_dump($ch);
    $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    //var_dump($code);

    if($code == 200){
        $status = true;
    }else{
        $status = false;
    }
    curl_close($ch);
    return $status;
}
  • 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-31T15:22:56+00:00Added an answer on May 31, 2026 at 3:22 pm

    Try the following code and check whether it’s working for you. It has been tested to work fine on XAMPP 1.7.7 .

     <?php
        // Create a curl handle
        $ch = curl_init('http://www.yahoo.com/');
    
        // Execute
        curl_exec($ch);
    
        // Check if any error occured
        if(!curl_errno($ch))
        {
         $info = curl_getinfo($ch);
    
         echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url'];
        }
    
        // Close handle
        curl_close($ch);
        ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem, i'm working on a gallery php script and need help,
I have have problem while using the cURL in my php script. Wheni used
In my PHP file I have a line which checks that the curl extension
I have a strange problem working with HTML,CSS in different browsers: Firefox 3.6 and
I'm working with oscommerce and i have problem with Paypal ipn When someone makes
I working on project and have problem with threading and update of UI. I
I have a small problem when im working with a menu and a list
I have a problem with my CSS on a website I'm working on .
i have a problem. I am working on a chatting application. I want to
I have a problem but first i want to know if im working on

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.