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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:21:27+00:00 2026-06-12T18:21:27+00:00

What is the fastest way to execute many PHP pages. I will not need

  • 0

What is the fastest way to execute many PHP pages. I will not need to see them (i.e. scrape or retain any information from any html that is output), but they need to load. The PHP code within each page needs to be executed.

I first started out doing foreach (...){echo <iframe src=.... (very ugly and took very long and very bad idea)

Now I’m thinking to set a jquery timer to keep loading ajax requests and go through an array.

Is there a better way to go about this?

  • 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-12T18:21:29+00:00Added an answer on June 12, 2026 at 6:21 pm

    Multi-threading is going to let you call URL’s as fast as possible as you can have multiple loading at the exact same time. PHP doesn’t really have good support for multi-threading but we can have it do multi-processing. This will allow you to kick off a URL request and immediately kick off more without waiting for any of the pages to load.

    The following code is an example of how to accomplish this using wget. This will be fast but does have the downside of not letting you know about a success or failure.

    <?php
    foreach($pages as $page){
        exec('/usr/bin/wget '.$page.' > /dev/null 2>&1 &');
    }
    ?>
    

    This could be taken a step further to call your own php script instead of wget. In which case your program can log the urls that failed to load.

    So a complete example could be something like the following:

    run.php

    <?php
    foreach($pages as $page){
        exec('loadPage.php '.$page.' > /dev/null 2>&1 &');
    }
    ?>
    

    loadPage.php

    <?php
    $handle = curl_init($url);
    curl_setopt($handle,  CURLOPT_RETURNTRANSFER, TRUE);
    $response = curl_exec($argv[1]);
    $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
    if($httpdCode != '200'){
        $fp = fopen('error.log', 'w');
        fwrite($fp, 'The URL '.$url.' had an issue. It returned a '.$httpCode.' error.');
        fclose($fp);
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Fastest way to uniqify a list in Python without preserving order? I saw many
What's the fastest way to populate an array with the numbers 1-100 in PHP?
I need to know : What is the fastest way to download several thumbs
What is the absolute fastest way to hash a string in PHP? I have
What is the fastest way to execute a method on an ASP.NET website? The
What is the fastest way of getting the area of any arbitrary Windows region?
What is the fastest way to fill up a pre-allocated ByteBuffer in Java? I
What is the fastest way to extend the front of an array in python?
I thought maybe the fastest way was to go with Sound Services. It is
What's the fastest way using either DOS scripting or PowerShell to run this simple

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.