A Web server is a software that resides on a computer and serves the request from the user via a web browser to send them HTML data as output. It processes requests via HTTP network protocol to provide information on the World Wide Web.
When a web server receives a request to access a web page, after performing the needed security check may run the server side programming language to process the request. As an example, if you request an HTML page from a web server, it will check if the file exists on the computer’s hard disk and if it does, it will send the content of the file in HTML format. If the file doesn’t exist, it will throw a file not found on server error. If the request is a PHP file, the web server after processing the needed security check, will pass the request to the PHP server module and retrieve the output from the module and send the output to a web browser.