Page 1 of 1
how php works with apache
Posted: Fri Jan 03, 2003 3:51 am
by zia
I have just registered and this is my first topic. I have been able to install php on Windows 2000 and to connect it with Oracle 9i database via Oracle HTTP server powered by apache. But it is not clear to me what is going on behind the scene? How php and apache is working? If someone can give me a clear picture of the technology.
Thank you all on this forum
Posted: Fri Jan 03, 2003 11:38 am
by m3mn0n
my best guess is researching on
http://www.oracle.com
Posted: Tue Jan 07, 2003 1:08 pm
by volka
the webserver gets an HTTP request. The header contains the path to the requested document (e.g. access.log: xxx.xxx.xxx.xx - - [23/Dec/2002:15:31:23 +0100] "GET /index.php HTTP/1.1" 200 1634. If the server finds an appropriate document (e.g. /usr/local/htdocs/test.php) it tries to handle it.
Your httpd.conf might contain something like AddType application/x-httpd-php .php associating files having the extension .php with the mime-type application/x-httpd-php.
Via AddModule mod_php4.c the php-module was loaded and it told apache that it will handle documents of the mime-type */x-httpd-php.
So, if a document like /index.php has been requested apache will call the php-module and advise it to execute the script.
The php-module 'knows' how to retrieve server/request-data like in $_SERVER, $_GET, ... (or where and how apache stored it) and how to deliver the datastream that is to be sent back to the requester.