Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a PHP file handle multiple requests?

Instead of starting new instances of a PHP script when an HTTP request is received, is there any way for one PHP script to handle multiple requests?

like image 989
Robin Rodricks Avatar asked Feb 04 '26 13:02

Robin Rodricks


1 Answers

PHP is built around the "Share Nothing" concept which gives you the ability to load balance and scale an application better by having a distributed network. So "no" this cant be done. If you imagine the initiation costs are high then maybe adjust the architecture to conceptually 'cache' your objects/data/views as much as you can. Use serialize() or something.

like image 78
Sabeen Malik Avatar answered Feb 07 '26 03:02

Sabeen Malik