0
0
PHPprogramming~5 mins

PHP process model per request - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What happens to a PHP script during a single web request?
The PHP script is loaded, executed from start to finish, and then the process ends. Each request starts a new process or thread that runs the script independently.
Click to reveal answer
beginner
Why does PHP use a process model per request?
To keep each request isolated, so errors or data from one request do not affect others. This makes PHP simple and secure for web applications.
Click to reveal answer
beginner
How does PHP handle variables and memory between requests?
Variables and memory are created fresh for each request and destroyed when the request ends. PHP does not keep variables or memory between requests.
Click to reveal answer
intermediate
What is the role of the web server in PHP's process model?
The web server receives the request, starts a PHP process or thread to run the script, then sends the output back to the client after the script finishes.
Click to reveal answer
intermediate
How does PHP's process model affect performance?
Starting a new process for each request adds some overhead, but PHP uses techniques like opcode caching to speed up execution and reduce delays.
Click to reveal answer
What happens to PHP variables after a web request finishes?
AThey are sent to the client browser
BThey are saved automatically for the next request
CThey are destroyed and do not persist to the next request
DThey become global variables
Which component starts the PHP process for each request?
AThe client browser
BThe operating system scheduler
CThe database
DThe web server
Why does PHP create a new process for each request?
ATo isolate requests and avoid data sharing
BTo save memory between requests
CTo keep variables persistent
DTo speed up the server startup
What technique helps PHP reduce the overhead of starting a process each request?
AOpcode caching
BDatabase indexing
CClient-side scripting
DSession cookies
In PHP's process model, when does the script execution end?
AWhen the user logs out
BAt the end of the request
CAfter 10 requests
DWhen the server restarts
Explain how PHP handles a web request from start to finish in its process model.
Think about what happens each time you load a PHP page in your browser.
You got /6 concepts.
    Describe the advantages and disadvantages of PHP's process model per request.
    Consider both how it helps and what challenges it creates.
    You got /5 concepts.