Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Understanding Apache, MySQL, and PHP

From: Installing Apache, MySQL, and PHP

Video: Understanding Apache, MySQL, and PHP

If you're new to the world of Apache, MySQL and PHP, or if you're trying to figure out what's the best way to install these software products on your local disk, it's worth taking a few moments to review how these software products work together to support a web application. Web-based applications are sometimes known as multi-tier applications, that's because they're built with multiple software products or multiple tiers. There are four major tiers in a web application: the client, the web tier, the business tier and the data tier.

Understanding Apache, MySQL, and PHP

If you're new to the world of Apache, MySQL and PHP, or if you're trying to figure out what's the best way to install these software products on your local disk, it's worth taking a few moments to review how these software products work together to support a web application. Web-based applications are sometimes known as multi-tier applications, that's because they're built with multiple software products or multiple tiers. There are four major tiers in a web application: the client, the web tier, the business tier and the data tier.

The client tier is a web browser. The browser software is installed on your local computer whether that'd be a desktop or a laptop computer, or a mobile device such as a smartphone or a tablet. The job of the browser is to send requests to the server and then to receive and render HTML, images and cascading style sheets. All modern web browsers can execute client-side code. They can all execute JavaScript and if they support the feature, they can also execute code supported by plug-ins such as Flash Player, Silverlight or Java.

All of the other tiers of a web application go into the server environment and taken together, they are known as the server stack. There are three server tiers. The web tier is the HTTP server. It receives requests from the client and returns responses. The HTTP server dispatches requests to the business tier, an application server, and the application server interacts with the data tier, the database server. In the world of Apache, MySQL and PHP, these roles are filled by Apache in the web tier, PHP in the business tier and MySQL in the data tier.

As a web application developer, you will find it useful to be able to install these software products locally, so that you can develop and test your code before you upload it to a production server. There are a number of ways of doing this. One approach is to install each element of the AMP stack individually. You'll be able to download all the software you need for free from these web sites at Apache, PHP and MySQL. On Mac OS X, Apache and PHP are already included, you just need to activate them, and then you install MySQL separately.

On Windows, you will install all of the components separately. And in later videos of this series, I'll show you how to do this on each of these operating systems. As of the time of this recording, it's very easy to install PHP 5.3 with Apache, but if you want to move to the newest version of PHP, 5.4, you'll find it takes a little bit more work. In this version of the course, I primarily focus on PHP 5.3 and offer some tips about 5.4 where they're available.

One of the advantages of installing these software products individually is that if you need to upgrade one element, you won't need to uninstall the others. When you use the integrated software bundles I'll describe next, most of the time you'll find that in order to change your software, you have to uninstall everything and reinstall everything. Individual components give you more control. The advantage though of the AMP software bundles is that they're very easy to install and get started with. All of the software bundles that I'll describe here are free to download and easy to set up.

If you're a Windows developer, you might consider WampServer, and if you're a Mac developer, you might look at MAMP. These are the software bundles that I typically use in my courses that involve PHP, MySQL and Apache. There are other bundles available too and they each have their own benefits. These three software bundles are available for multiple operating systems; Windows, Mac and Linux. There is XAMPP, spelled with an X, BitNami and Zend Server Community Edition.

When you choose an AMP distribution, it's good to know some of the benefits of each. For example WampServer and XAMPP both install by default using the standard ports for Apache and MySQL. If you're working with MySQL and PHP, using Dreamweaver for example, you'll find that you have to use port 3306 with MySQL and if you use an alternative port, Dreamweaver won't be able to connect to that database. WampServer and XAMPP set up these software products exactly how Dreamweaver would expect them to be set up and also how they are set up in a production environment typically.

MAMP, on the other hand, by default uses alternative ports. This gives you the advantage on Mac of being able to run side-by-side with the versions of Apache and PHP that are included in the operating system. But MAMP also makes it very easy to reset to the standard ports, port 80 and 3306. BitNami has distributions that include common PHP applications such as WordPress, Drupal, and Joomla! and many others. If your goal is to get started with one of these content management systems, you'll find that BitNami provides a very easy road forward.

Also BitNami, uniquely among all of these bundles as of the time of this recording, offers versions that integrate PHP 5.4. These versions, again at this moment, are available only for development and not for production. But if you want to get started with PHP 5.4, BitNami offers a very easy path. One of the most important things to consider is that you can only have one copy of each software product running on each port at a time.

You could have more than one copy of MySQL running, but only one can listen on port 3306, and only one copy of Apache can be listening on port 80. So it's a good idea to choose one approach and then stick with that approach on each individual computer. Particularly on Windows, installing both an AMP bundle and the separate components can cause a lot of problems. You'll find that sometimes you will get DLL conflicts, different versions of a particular component that conflict with each other and prevent one or both of these software components from starting up at all.

So on Windows, install the separate components or an AMP bundle, but not both. And finally, if you install two AMP bundles on a single computer, make sure you deactivate the first before you start up the second. There are some combinations of these software bundles that can be installed side-by-side, for example MAMP and the included components of Mac OS X as long as they're listening on different ports. But if you want to make sure that your software is going to run the first time every time, install one of these bundles and stick with that bundle and don't install anything else on that particular computer.

Show transcript

This video is part of

Image for Installing Apache, MySQL, and PHP
Installing Apache, MySQL, and PHP

39 video lessons · 44535 viewers

David Gassner
Author

 
Expand all | Collapse all
  1. 17m 35s
    1. Welcome
      1m 9s
    2. Understanding Apache, MySQL, and PHP
      7m 12s
    3. Using the exercise files
      1m 7s
    4. What's new in this update
      3m 35s
    5. Choosing a software stack
      4m 32s
  2. 30m 18s
    1. Installing Apache HTTP Server 2.4 on Windows
      6m 51s
    2. Installing PHP 5.5 on Windows
      4m 12s
    3. Starting Apache from the command line
      5m 24s
    4. Installing MySQL on Windows
      7m 24s
    5. Installing phpMyAdmin on Windows
      6m 27s
  3. 44m 5s
    1. Activating Apache on Leopard and Snow Leopard
      3m 35s
    2. Activating Apache on Lion
      5m 9s
    3. Activating Apache on Mountain Lion and Mavericks
      4m 57s
    4. Configuring personal site folders on Mountain Lion and Mavericks
      6m 59s
    5. Activating PHP on Mac OS X
      6m 12s
    6. Installing MySQL on Mac OS X
      3m 59s
    7. Setting the root user password
      2m 28s
    8. Installing phpMyAdmin on Mac OS X
      6m 16s
    9. Uninstalling MySQL on Mac OS X
      4m 30s
  4. 14m 35s
    1. Installing WampServer
      6m 25s
    2. Managing WampServer
      2m 2s
    3. Defining directory aliases through WampServer
      2m 55s
    4. Changing software versions with WampServer add-ons
      3m 13s
  5. 10m 58s
    1. Installing MAMP
      4m 6s
    2. Configuring Apache and MySQL server ports
      1m 57s
    3. Managing MAMP
      4m 55s
  6. 29m 3s
    1. Installing XAMPP for Windows
      10m 0s
    2. Managing XAMPP for Windows
      4m 4s
    3. Managing MySQL security through XAMPP for Windows
      2m 40s
    4. Installing XAMPP for Mac OS X
      6m 14s
    5. Managing XAMPP for Mac OS X
      2m 27s
    6. Managing MySQL security through XAMPP
      3m 38s
  7. 13m 20s
    1. Installing BitNami for Windows
      6m 31s
    2. Installing BitNami for Mac OS X
      6m 49s
  8. 18m 49s
    1. Handling port conflicts with Skype on Windows
      2m 37s
    2. Handling other port conflicts on Windows
      5m 19s
    3. Detecting and handling port conflicts on Mac OS X
      6m 26s
    4. Configuring Apache to work with IPv6 on Windows 8
      4m 27s
  9. 31s
    1. Goodbye
      31s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Installing Apache, MySQL, and PHP.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.