Start learning with our library of video tutorials taught by experts. Get started
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 the last movie we saw how to get php turned on and working with Apache. And we saw how to use the PHP info function in order to ouput our current configuration information for PHP. We also see that we have version 5.3 installed by default, we're going to upgrade that now to the latest version of php. If we go to the PHP website you'll see that the latest version at the moment. This is 5.5 alpha. That's not a fully released version. It's an alpha version. Over here it tells us the current stable version of PHP 5.4 is 5 4 11. So that's what I want to install.
Now the odds are very good that by the time you do this installation, that will have changed. It will be a later version. You want to use whatever the latest version is. You don't need to use what I'm using. Go ahead and install a later version. If 5.5 is out, go ahead and use 5.5 as well. Now, if we look at the manual for PHP and that can be found from the documentation area. If you look down, there installation configuration is one of the options and installation on Mac OS 10 is an option. This will give us the latest information about installing PHP on Mac OS 10. Using packages is the one that we want to click.
That's by far in a way going to be the easiest and it gives us some suggestions on ways to do that. If you're familiar with any of these, Mac Ports, Think, or Homebrew, you definitely want to go with one of those options. It's going to be very simple. So if you're familiar with those, you already have those working, those are a great choice for keeping you PHP upgraded. If not though you are going to use another package to install. They suggest something called Entropy but Entropy is no longer supported or maintained but you can see is that in this user contributed notes.
Instead, it's being maintained at this URL here. So I've already gone to that URL. Here it is. It's php-osx.liip.ch. This is where this PHP package is being maintained. This is considered a safe and reputable source for installing PHP. You can actually browse the code that they've got, that they're using here, if you want to make sure that it's safe. But I think you can trust it. So if you look down, they give you some simple one line installations that you can use. This is very nice.
If we want PHP 5.4. Well guess what? We just have to copy this line right here. And I can do that with Cmd + C. And then we can go over here to our terminal, and just paste it in, and hit return. And it will now install. This version for us. So it's getting the package. It wants our password to install because it's installing some software. And then we'll start installing. So we'll just sit and wait while it finishes doing its thing. So now that, that worked, we're ready to check it out.
Lets go back to our PHP info page. And lets just hit reload. Let's reload the page, and you can see now I'm running 5.4.11, so that's the version that it installed for me. Now if you go back and you go to your command line, I just want to show you if you do php -v, you actually still get version 5.3, it still tells you that you're running 5.3. That's because both of them are still installed and the web server is pointing at one of them While the command line is looking at a different one.
So don't let that throw you. This is the authoritative one. This is the one that tells you what Apache sees, and what Apache is using, and since we are not going to be running PHP from the command line, we're only going to be running PHP through Apache, that's what matters most. Now that we have it upgraded, we have PHP 5.4 installed, now we are ready to do some configuration of PHP.
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.