How it works

The request is received by the Operating System I.e Linux and then the request is handed over to apache..

Apache handling the request check if the url requested is a PHP or a CGI page.. If yes it hands over the request to the PHP interpreter.. Now it replies with the requested resource eg :- index.html etc..

The PHP interpreter parses the requested file , executes the PHP Code .. If the code includes database queries the request is handed over to MySQL … Mysql deals with the requests received and executes them...

Once the script interpreter has completed executing the program it returns the result to the browser..