Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In this chapter, we're going to be learning how to install PHP and MySQL on a Macintosh. I want to start out by first giving you an overview of what we're going to do before we go through each of the steps. The first thing we're going to need to do is make sure that we have a web server. And that's going to serve up the web files, process the PHP for us, and respond to requests from browsers. So, we're going to have a browser, makes a request to the web server. Apache web server is included with Mac OS 10. And it's been there for a number of different versions. In Mac OS 10.8, we have version 2.2 included.
So that's already there. There are a couple of differences though from this version, from previous versions of Mac OS 10. Starting with version 10.8, they removed the web sharing option that you find in the system preferences. So we're going to have to learn how to start and stop Apache without that. So I'm going to show you how to do that. They also removed the sites directory. There's normally a default directory called sites. And that's where we would put our code, but they've taken that away now. It's not there it wasn't deemed to be sort of an important feature for most people, because most people aren't developing.
So it's something that we'll have to recreate there. And we'll have to do a little bit of configuration on Apache to get it to do what we need it to do. Then we're going to need to make sure that we have PHP installed, of course. PHP also comes included with Mac OS 10.8. And that's version 5.3. Now that's not the latest version of PHP. And that often happens, when they finally ship a version of Mac OS 10. Sometimes it will be just a little bit behind the latest PHP version. Now you could use 5.3 and save yourself the trouble of upgrading. Just go right with 5.3 right from the start, and almost every single thing we're going to learn will work perfectly well.
And I'll highlight the things that wouldn't. However, I'm also going to show you how to upgrade to the newest version, to make sure that we have the newest version as well. And then we're going to need to do a little bit of configuration to PHP's option. After we do that, we're going to make sure that we have MySQL, that's going to be our database that we're going to use. So we want to make sure that's installed. So we'll download and install it from the MySQL website. It's not included with Mac OS 10. And we'll need to do a little bit a configuration to it. And we're going to need to set a root password, so that every time we access the database, we're going to have a password to authenticate ourselves. To say, yes, I'm allowed to get this data out of the database. So we'll learn how to set a root password for that. And then last of all, we're going to need to have a text editor. So we're going to download and install TextMate.
Now, you can install a number a of different text editors and we are going to talk about what some of the options are, but TextMate is the one I'm going to show you to use. Okay, so let's get started by seeing how we set up the Apache web server.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101837 Viewers
61 Video lessons · 88587 Viewers
71 Video lessons · 72405 Viewers
56 Video lessons · 104101 Viewers
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.
Your file was successfully uploaded.