How Does PHP Interface With Apache Server In Definition
Posted By
Bajarangi soft ,
Posted On 16-09-2020
When someone requests for a webpage from their browser,the browser resolves the domain name to an ip address by taking up the DNS server, the request is then sent to the ip address on Port 80.
List of PHP interface with Apache
- PHP resource can be processed before it is served by Apache via HTTP(hypertext transfer protocol) is a network protocol built for TCP and for IP ( TCP/IP).
- submit a form, your browser sends a request through HTTP.
- The format has some metadata in the headers and a method (GET, POST, PUT, or PATCH) URI that tells the server what resource looking for user needs to send to the server.
- Apache is web servers. The server requests.
- Apache takes right file and serve that back up to the browser.
- Apache normally serves files by fetching the file and sending the stream down the HTTP connection. With PHP, however, Apache fetches the file, pipes it into the PHP binary, and sends the output stream from the HTTP connection.
- Module - this involves linking the php interpreter against a library of hooks published by the webserver.
-
CGI - the webserver starts up an instance of the interpreter for each request and passes parameters to the interpreter through stdin, the command line and environment variables, stdout is sent to the client and stderr should be written to the error_log.CGI script was to be executed, it contained a special line that told the server what command should be run to process the script. This line will approach the server to invoke an interpreter that would execute the script.
- fastCGI - this eliminates the overhead of starting a new process for each request - the interpreter runs as a daemon
- CGI is the simplest to implement but does not scale/perform well, the module would be the hardest by far. FastCGI is nearly as fast as the module approach. CGI and fastCGI are open, well documented APIs.