PHP works through a multi-step lifecycle process when handling web requests. It includes: 1. Parsing, compilation, and scanning of PHP code when the web server starts. 2. When a request is made, PHP initializes extensions and populates variables through each extension's MINIT and RINIT methods. 3. PHP executes the requested page's code. 4. After page execution, PHP performs cleanup by calling each extension's RSHUTDOWN method and unseting variables. 5. PHP finally shuts down by calling each extension's MSHUTDOWN method to unregister handlers and free memory.