Home arrow PHP arrow Page 4 - The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP

How it Works - PHP

The much anticipated update to our original article on getting Apache, MySQL, Mod_SSL, and PHP to work seamlessly with each other is finally here! Ever try to get Apache, Mod_SSL, PHP, and MySQL all working in harmony on the same box? It's a very difficult task, but article author Israel Denis Jr. has come up with detailed instructions for compiling all these and getting them working together seamlessly to make the killer server software system.

TABLE OF CONTENTS:
  1. The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP
  2. Assumptions
  3. Prerequisites
  4. How it Works
  5. Game Plan
  6. PHP Installation (*NIX)
  7. Apache
  8. Testing Our Work: Is Apache working?
  9. Is SSL Working?
  10. Are PHP and MySQL Working Together?
  11. Conclusion
By: Israel Denis Jr. and Eugene Otto
Rating: starstarstarstarstar / 41
June 07, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
It is helpful to understand what happens behind the scenes. Here is an over-simplification of how things work. The diagram below and the explanation that follows aren't entirely accurate but serve as a quick overview for now:

The scenario: We have a web page that pulls some data out of a DB. John Doe requests this page from his browser, the request is sent to the web server which in turn calls a PHP script. The PHP script is interpreted by the PHP preprocessor and pulls data from the database. The results are then processed by the rest of the PHP script and turned into HTML. The final HTML then gets sent back to the user's browser.



Let's look at this step by step:
  1. John Doe clicks on a link to from his web browser; his web browser sends the request for http://localhost/test.php.
  2. Apache gets the request for test.php. It knows that .php files are handled by the PHP preprocessor (mod_php) because we specified it in the Apache configuration file, so it tells PHP to deal with it.
  3. test.php is a PHP script that contains commands. One of these commands is to open a connection to a database and grab data. PHP handles the connection to the database, and interprets the SQL calls to extract data from the database.
  4. The database server gets the connection requests from the PHP interpreter, and processes the request. The request could be something like a simple select statement, or a table creation.
  5. The database then sends the response and results back to PHP interpreter.
  6. Apache sends the PHP information back to John Doe's browser, as the response to his request. John Doe now sees a web page containing some information from a database.
If this had been a request for https://localhost/test.php, then the process would be a little different.
  1. Every request and response is encrypted and decrypted at both ends. That is, the browser connects to Apache, obtains its encryption key, encrypts the request and sends it over.
  2. The server sees the request decrypts it and authenticates it. It processes the file, encrypts it and sends it over. The browser then decrypts it with the server's key. Keep in mind that since the connections are encrypted, different ports are used. Port 80 used in the non-secure connection, while port 443 is used in the secure connection.
Again, that's not 100% correct but it's a very simplistic overview of what goes on behind the scenes. Now that you have a basic understanding of what we are trying to accomplish, let's get on to installing the software.

 
 
>>> More PHP Articles          >>> More By Israel Denis Jr. and Eugene Otto
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: