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.
The Apache web server supports the concept of aliases. An alias is a virtual directory that points to a location on disk and you can address the alias through the web browser and retrieve documents from the disk in this manner. The directories that you set up as aliases don't need to be under the document root folder. You can make them independent on your disk. To demonstrate this I've created a folder under my CDrive root named mywebapp and I've created a simple file called index.php under it.
I'll open the file in Notepad and show you that it executes a simple PHP command, php.info, which outputs the current PHP configuration to the screen. Now this directory is not under my WAMP folder, that's the document root, and I want to make the entire directory accessible through the browser. So I'll go to the WampServer administrative menu and choose Apache > Alias directories > Add an alias. That opens up a command-line window. I'll type in the name of the alias that I want to create.
It's going to appear to the browser as a directory under the localhost or 127.0.0.1 root. I'll name my alias webapp, then I'm asked to type in the full location of the physical directory, using forward slashes. I'll type c:/mywebapp/ and press Enter. That creates the alias. Next, I'll go to the WampServer administrative menu and I'll make sure that the Apache web server is restarted by checking the color of the gauge.
If it's not white, just open up the menu and choose Restart All Services. Once the gauge shows you that all the services have restarted, you can go to a browser and test the new alias. I'll type in http://localhost/webapp/ index.php and if the alias is working correctly, I should see the output of the PHP info command, showing me my PHP configuration.
If you don't see this display, if for example you see the actual PHP code or you're prompted to download the PHP file to your hard disk, that means Apache didn't successfully restart. You should stop Apache completely and then restart and if all else fails reboot your computer to continue onward. You can add as many aliases to your Apache configuration as you like. The advantage of an alias is that the folder containing your web files is outside the WAMP document root and therefore outside the WAMP installation root folder.
You can manage your files much more easily, but you can also add whatever PHP files, HTML files, image files, and other web assets you need to construct your web site.
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.