Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    1
    Member #
    19327
    Just picked up a book on MySQL, APACHE and PHP and it's not really clear on the relationship among the three. I'm interested in designing a database driven web-site and I feel that I have a decent handle on what MySQL and PHP are but I'm not even sure if I need to install APACHE on my PC. Right now, I'm trying to get up and running with MySQL and PHP so I can use the book to do the exercises and learn the commands.
    I get the feeling that APACHE is not required for this and that the future host of my web-site will provide that functionality. Is this correct or am I way off? Also, can I play around with MySQL and PHP without APACHE installed on my PC.
    Any help will be appreciated. Thanks.

  2.  

  3. #2
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Apache is a server you can install on your own pc. If you want to test php web pages locally, then you need apache, or some other down loadable server, but Apache is the standard and most reliable. So to do testing on your own machine, then you need to install Apache, MySQL, and PHP on your computer. You can not view php pages by previewing in a browser like you can with html pages, they must run through a server, since php is a server side scripting language.

    There are all in one installations like Xampp, or Wamp. These will put all 3 on your machine. Some prefer installing the 3 seperately because they can customize some of the configurations. I installed Xampp and it went pretty smooth for a beginner in php. The only thing that really tripped me up a bit was setting the admin password, sounds stupid but it got me confused!

    Also, you can avoid all this and test it online thru your host. If you have broadband connection and a good ftp (like Dreamweaver), you can test that way.

    So, to sum up...
    MySQL and PHP need to go thru a server, that's where Apahe comes in. PHP uses mysql databases to "get" info to run scripts, so all 3 work together.

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    A typical process when you view a web page written in PHP:
    1. Your browser sends a request to the web server (Apache)
    2. Apache recognizes that you requested a .php file, and passes the request to PHP.
    3. Your PHP code is invoked, and your code likely connects to MySQL and runs some queries.
    4. MySQL executes the queries and returns results back to your PHP.
    5. Your PHP generates some output (HTML), which is passed back to Apache
    6. Apache sends the HTML back to the browser and the connection is closed.

    If the page is written well, the entire exchange can take milliseconds.

    Apache and MySQL are both servers in that they're running all the time, listening for requests. Apache receives all requests made by your browser, and MySQL (in this case) is listening for requests made from your PHP. PHP is just a language and a parser; it's not really listening for anything but Apache invokes it when it determines that it's needed to handle the request.

    Of all things, you should read how the HTTP protocol works. It's very simple yet it seems most people don't know it. Once you get how HTTP works, it will make a lot of sense.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Oh no, not the 7 layers!=-O


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com