Viewers: in countries Watching now:
PHP is a popular, reliable programming language at the foundation of many smart, data-driven websites. This comprehensive course from Kevin Skoglund helps developers learn the basics of PHP (including variables, logical expressions, loops, and functions), understand how to connect PHP to a MySQL database, and gain experience developing a complete web application with site navigation, form validation, and a password-protected admin area. Kevin also covers the basic CRUD routines for updating a database, debugging techniques, and usable user interfaces. Along the way, he provides practical advice, offers examples of best practices, and demonstrates refactoring techniques to improve existing code.
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.
Find answers to the most frequently asked questions about PHP with MySQL Essential Training .
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.