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 8372985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:34:06+00:00 2026-06-09T14:34:06+00:00

I am using a dedicated server. 1gbps port. There are the following code (which

  • 0

I am using a dedicated server.
1gbps port.

There are the following code (which connects with facebook)

    if($_POST['friend_id'] != 0) {
        $query = "SELECT uid, first_name, pic, sex FROM user WHERE uid = ".$_POST['friend_id'];
    }
    else {
        $query = "SELECT uid, first_name, pic, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me() order by rand() limit 1)";
    }

    $query = urlencode($query);
    $fql_query_url = 'https://graph.facebook.com/'. 'fql?q='.$query. '&access_token=' . $access_token;
    $response = $facebook->api("/fql?q=$query");
    $data = $response['data'];

Then I use the uid to get the photo of the user.

    $img = file_get_contents('https://graph.facebook.com/'.$friend_id.'/picture?type=normal');
    $imagesurse1 = $friend_id.uniqid().'.jpg';
    file_put_contents($imagesurse1, $img);

    $img = file_get_contents('https://graph.facebook.com/'.$user_id.'/picture?type=normal');
    $imagesurse2 = $user_id.uniqid().'.jpg';
    file_put_contents($imagesurse2, $img);

These code is taking 10 secs to xx seconds. xx reached upto 60.
What could be the problem.

It is a site app. Site doesnot have “https”

  • 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-06-09T14:34:07+00:00Added an answer on June 9, 2026 at 2:34 pm

    Facebook is normally pretty slow. Can’t you cache your results?
    Can you test your code piece by piece so you can figure out which part is causing the trouble?

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

Sidebar

Related Questions

Are there any known methods of finding peers without using a dedicated central server?
Using SQL Server 2008 R2 we are looking for a way to select the
I have a plesk panel and root dedicated server on 1and1. I'm using custom
i am using virtual dedicated server and the configuration is windows server 2008 R2
I have the following setup: Dedicated server --> Internet --> Modem (telenet) --> Router
I have two specs from two different hosts I am using: (a) Dedicated server
How to check which sql query is taking more time? (MYSQL) Im using a
I want to create website thumbnails (screenshots) using php. I have a dedicated server
We have a client that can't receive emails from a dedicated server using PHP
We are using a linux dedicated server in our company. Whenever we create a

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.