Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"How the sausage is made" tour of apache/php/mysql interaction

Tags:

php

mysql

apache

I am having trouble understanding how apache/php/mysql stack works on a low level (including interaction with the browser). Is there a good description somewhere (a book, a website, etc) that will walk me through the whole path and explaining how starting with a browser reqesting a url, http requests is being sent, how apache talks to php, how php talks to mysql (persistant and non-persistant connections), etc, etc. I want to understand what waits for what in this chain, where timeouts are handled, how long sockets are opened and closed. A book, an article maybe? There is a lot of documentation on each individual component, but I can't find a "walkthrough".

The explanations I se so far are very high-level: look, here's a happy cow, it goes to Bovine University, look - it's all shrink wrapped on the supermarket shelf. What I need is the sausage farm/slaughterhouse/truck/factory tour, starting with cow insemenation :)

[update] To this day I have not found a better way to learn about these things other than reading the source.

like image 810
deadprogrammer Avatar asked Jun 09 '09 16:06

deadprogrammer


2 Answers

PHP and MySQL by example has a pretty basic picture of the process, which I think you probably already understand.

Getting more in-depth than that picture though is a pretty long discussion. Ironically, you can read the book I just linked for a pretty good description. If you have more specific questions, I recommend opening new questions for them. Enjoy!

like image 176
Brent Avatar answered Oct 10 '22 13:10

Brent


I have found a site that has, at least in part, contents from the book Advanced PHP Programming by George Schlossnagle.

The site is located at: http://php.find-info.ru/php/016/toc.html. Specifically, the section on The PHP Request Life Cycle contains a lot of the nitty-gritty details, including some source code and diagrams.

DISCLAIMER: IANAL, but considering that the book is still listed on Amazon, its possible the content linked to above breaks all sorts of codes, rules and/or laws. Its not my intention to proliferate or condone illegal or pirated materials, so if that be the case, please remove said links.

like image 31
ken Avatar answered Oct 10 '22 13:10

ken