Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Installing Apache, MySQL, and PHP with David Gassner describes how to install and configure Apache HTTP server, MySQL database server, and PHP, known as the AMP stack, on a local development computer. Chapters are devoted to multiple installation approaches: installing the components separately on both Windows and Mac (including coverage of Apache and PHP on Mac OS X 10.7 Lion and 10.8 Mountain Lion), installing the pre-packaged Apache and MySQL distributions in WampServer on Windows and MAMP on Mac, and installing the cross-platform XAMPP and Bitnami on both Mac and Windows. Exercise files are included with the course.
This course was updated on 07/06/2012.
If you're working with Mac OS X and want to use separate components for your AMP stack, you're ahead of the game, because Mac OS X includes both Apache and PHP in its default installation. You just have to know how to turn them on. First, I'll show you how to turn on Apache. Go to the Apple menu and choose System Preferences. Then from there, click Sharing, which you'll find under Internet & Wireless. Mac OS X refers to the Apache web server as Web Sharing, which you can activate by simply checking the check mark.
When you activate Web Sharing, you're turning the built-in Apache web Server on. On this screen it will show you the IP address of your computer. Assuming that your computer is getting its IP address dynamically using an architecture known as DHCP, this IP address will be different on every computer. Notice that there are two possible links. The bottom one is a web site for the entire computer; the top one though, is a web site for the currently logged-in user. I'm logged in on my Mac as a user named LDC, for lynda.com, and so my personal web site is under the local IP address / then a tilde character, and then the username.
Now you don't have to use this dynamically generated address. If you click it, you'll see the default web page. Now, I'm recording on version 10.6 of Mac OS X. That's Snow Leopard. If you're using another version of Mac OS X, the web page may look different, but you should still see a confirmation that the Apache web server is running. But you can actually get to exactly the same web page and exactly the same location on your disk by using the local IP address that's common to all computers, 127.0.0.1.
Once again, I'm referring to the LDC folder using the tilde as a prefix, and that takes me to the same place. Yet another alternative is to use the word localhost. The localhost DNS name always points to the IP address 127.0.0.1. Typically, when you're doing local development, you should either use localhost or the IP address, the 127.0.0.1 address. Your instructors will typically use these addresses, rather than anything that's dynamically generated, and that will make sure that you're using the same address on your computers as they did on theirs and that it's working the same for everybody.
Now I'll show you where these files are stored. I'll go to Finder, to my personal directory, LDC. Under there, go to a folder named Sites. You'll find this, file index.html, and an images folder containing a few basic graphics. I'll double-click index.html to open it in a browser, and you'll see that it looks exactly the same. So this folder, the Sites folder under your home directory, is what's known through Apache as the document root.
Each user that's logged in to a particular Mac has their own personal document root, and then there is also a computer-wide document root, which is stored on your Mac hard disk under /library/web server/documents. So once you know how easy it is to turn your Apache web server on, you'll be ready to go onto the next step, activating PHP, and I'll show you how to do that in the next video.
Find answers to the most frequently asked questions about Installing Apache, MySQL, and PHP.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.