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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:29:15+00:00 2026-05-12T15:29:15+00:00

If the PHP Engine is already in the middle of executing a script on

  • 0

If the PHP Engine is already in the middle of executing a script on the server what would happen to other simultaneous browser requests to the same script?

  • Will the requests be queued?
  • Will they be ignored?
  • Will each request have its own script
    instance?
  • Any other possibility?
  • 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-12T15:29:15+00:00Added an answer on May 12, 2026 at 3:29 pm

    The server, depending on its configuration, can generally serve hundreds of requests at the same time — if using Apache, the MaxClients configuration option is the one saying :

    The MaxClients directive sets the
    limit on the number of simultaneous
    requests that will be served.
    Any
    connection attempts over the
    MaxClients limit will normally be
    queued, up to a number based on the
    ListenBacklog directive.
    Once a child
    process is freed at the end of a
    different request, the connection will
    then be serviced.

    The fact that two clients request the same page is not a problem.

    So :

    Will the requests be queued?

    No ; except if :

    • there is some lock somewhere — which can happen, for instance, if the two requests come from the same client, and you are using file-based sessions in PHP : while a script is being executed, the session is “locked”, which means the server/client will have to wait until the first request is finished (and the file unlocked) to be able to use the file to open the session for the second user.
    • the requests come from the same client AND the same browser; most browsers will queue the requests in this case, even when there is nothing server-side producing this behaviour.
    • there are more than MaxClients currently active processes — see the quote from Apache’s manual just before.

    Will they be ignored?

    No : this would mean only one user can use a website at the same time ; this would not be quite nice, would it ?

    If it was the case, I could not post this answer, if you where hitting F5 at the same moment to see if someone answered !

    (Well, SO is not in PHP, but the principles are the same)

    Any other possibility?

    Yes ^^

    edit after you edited the OP and the comment :

    Will each request have its own script
    instance?

    There is no such thing as “script instance” : put simply, what’s happening where a request to a script is made is :

    • the webserver forks another process to handle the request (often, for performance reasons, those forks are made in advance, but this changes nothing)
    • the process reads the PHP script from disk
      • several processes can do this at the same time : there is no locking on file reading
      • the file is loaded into memory ; in a distinct memory block for each process
    • the PHP file in memory is “compiled” to opcodes — still in memory
    • those opcodes are executed — still from the block of memory that belongs to the process answering your request

    Really, you can have two users sending a request to the same PHP script (or to distinct PHP scripts that all include the same PHP file) ; that’s definitly not a problem, or none of the website I ever worked on would work !

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

Sidebar

Ask A Question

Stats

  • Questions 231k
  • Answers 231k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the following function like this: Image('/path/to/original.image', '1/1', '150*', './thumb.jpg');… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer Check you database schema to see if the field (referenced… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer I figured out the problem - there was a session… May 13, 2026 at 2:13 am

Related Questions

I roamed the site for this question using the search engine, and I don't
We are working on a website for a client that (for once) is expected
I'm writing a simple templating layer in PHP but I've got myself a little
I just got a few PHP projects which are using a similar kind of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.