Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
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 most recent version of PHP as of the time of this recording was PHP 5.5. You can get the binaries for PHP 5.5 from Microsoft windows from this web page at windows.php.net/download. There are four different versions available. There are versions for 32 bit and 64 bit windows, and there are non-thread-safe and thread-safe versions. Even though I'm working on 64 bit Windows, I'm going to be using the 32 bit version of PHP.
It matches the 32 bit version of Apache that I already installed and most importantly, the 64 bit builds are currently marked as experimental. By using the 32 bit versions, you'll be using a version that's stable. Download the thread-safe version. That's the version that's compatible with Apache. It downloads as a Zip archive file. Just as with Apache, you can install it by simply extracting it to your hard disk. This Zip archive does not contain a top level folder. Its files are just children of the archive itself.
So, when you extract it, you'll need to create a folder to contain the files. The safest way is to right-click on the Zip archive and choose extract all. I'll extract the files to a new folder called c:/php. After the files have been extracted, Windows Explorer or File Explorer should open to show you the new folder. If it doesn't, open it yourself and scroll down toward the bottom. Look for this file, php5apache2_4.dll. This is a DLL that's used to connect to Apache at run time.
And to make it work altogether, you'll need to add some information to your Apache configuration file. Go to your Apache installation folder. Mine is in c:/apache. Go to your configuration folder named conf and open the httpd.conf file. Now, I've already added the correct lines to my file. They go down at the bottom of the file. So, you can simply copy from here and add these lines to your configuration file.
There are three directives. The Load module directive loads the DLL. The Add Handler directive says that when a file with a. php file extension is requested, it will be processed with this mime type. Application/x-httpd-php. And that connects it to the DLL. And finally, the PHP INI DIR directive says that the PHP configuration file, called php.ini is located in c:/php.
Make sure that you're using forward slashes and not backslashes for all of these configuration values. And when you're done entering them into your configuration file, save and close the file. Finally, to test PHP, you'll need a simple PHP script, and I've provided it in the free exercise files that accompany the course. It's named phpinfo.php. You might not see the. php extension, but if you move your cursor over the file, you'll see that it is a PHP file.
Copy that file to the clipboard, and paste it into your Apache folder's htdocs folder as I've done here. This file has a single, simple command, calling the PHP info function. Once you've copied the file into place, you're ready to test PHP. Go back to your command prompt. If Apache is still running, press Ctrl+C to stop it. And then start it up again. Type httpd and press enter. Now to test PHP, type the URL http://localhost/phpinfo.php and you should see this screen, indicating that PHP is working and that it's correctly configured within Apache.
If you have all that set up, you're ready to go on to the next step installing MySQL.
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.