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?
The server, depending on its configuration, can generally serve hundreds of requests at the same time — if using Apache, the
MaxClientsconfiguration option is the one saying :The fact that two clients request the same page is not a problem.
So :
No ; except if :
MaxClientscurrently active processes — see the quote from Apache’s manual just before.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)
Yes ^^
edit after you edited the OP and the comment :
There is no such thing as “script instance” : put simply, what’s happening where a request to a script is made is :
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 !