navigate site menu

Start learning with our library of video tutorials taught by experts. Get started

Installing Apache, MySQL, and PHP

Installing Apache, MySQL, and PHP

with David Gassner

 


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.
Topics include:
  • Performing Apache, PHP, and MySQL as separate installs
  • Activating Apache and PHP on Leopard, Snow Leopard, and Lion
  • Setting the MySQL root user password
  • Installing WampServer
  • Changing software versions with WampServer add-ons
  • Installing MAMP
  • Configuring MAMP's Apache and MySQL server ports
  • Installing XAMPP for Windows and Mac
  • Managing MySQL security through XAMPP
  • Installing Bitnami for Windows and Mac
  • Detecting and handling port conflicts
  • Working with Apache and IPV6 in Windows 8

show more

author
David Gassner
subject
Developer, Web, Servers, Databases
software
MySQL , PHP , HTTP Server , Apache HTTP Server
level
Intermediate
duration
2h 43m
released
Jan 21, 2011
updated
Jan 09, 2013

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:04Hi! I'm David Gassner.
00:05I'd like to welcome you to this newly updated course, Installing Apache, MySQL and PHP.
00:12The lynda.com online training library offers many training courses that depend
00:18on a local installation of what's commonly known as an AMP Stack.
00:22In this video series, I'll describe a number of ways to get started with a local
00:27AMP Installation on both Windows and Mac OS X.
00:31I'll show how to use the separate components from the vendors who manage
00:34these software packages.
00:36I'll also show you some easier ways to get started with free software bundles
00:40such as WampServer, MAMP, XAMPP and BitNami.
00:45I'll describe how to configure Apache for use on Windows 8,
00:50and I'll offer some troubleshooting tips, describing the issues that are reported
00:54most commonly by our members.
00:56We're going to continue to keep this course up-to-date as these
00:59software products evolve.
01:01I hope the course helps you get started quickly and easily with Apache,
01:05MySQL and PHP.
Collapse this transcript
Understanding Apache, MySQL, and PHP
00:00If you're new to the world of Apache, MySQL and PHP, or if you're trying to
00:05figure out what's the best way to install these software products on your local
00:09disk, it's worth taking a few moments to review how these software products
00:13work together to support a web application.
00:17Web-based applications are sometimes known as multi-tier applications, that's
00:22because they're built with multiple software products or multiple tiers.
00:27There are four major tiers in a web application:
00:30the client, the web tier, the business tier and the data tier.
00:35The client tier is a web browser.
00:38The browser software is installed on your local computer whether that'd be
00:42a desktop or a laptop computer, or a mobile device such as a smartphone or a tablet.
00:49The job of the browser is to send requests to the server and then to receive and
00:53render HTML, images and cascading style sheets.
00:57All modern web browsers can execute client-side code.
01:02They can all execute JavaScript and if they support the feature, they can also
01:07execute code supported by plug-ins such as Flash Player, Silverlight or Java.
01:14All of the other tiers of a web application go into the server environment and
01:19taken together, they are known as the server stack.
01:23There are three server tiers.
01:25The web tier is the HTTP server.
01:28It receives requests from the client and returns responses.
01:32The HTTP server dispatches requests to the business tier, an application server,
01:38and the application server interacts with the data tier, the database server.
01:42In the world of Apache, MySQL and PHP, these roles are filled by Apache in the
01:48web tier, PHP in the business tier and MySQL in the data tier.
01:54As a web application developer, you will find it useful to be able to install
01:58these software products locally, so that you can develop and test your code
02:02before you upload it to a production server.
02:05There are a number of ways of doing this.
02:08One approach is to install each element of the AMP stack individually.
02:13You'll be able to download all the software you need for free from these web
02:17sites at Apache, PHP and MySQL.
02:21On Mac OS X, Apache and PHP are already included, you just need to activate them,
02:28and then you install MySQL separately.
02:31On Windows, you will install all of the components separately.
02:34And in later videos of this series, I'll show you how to do this on each of
02:38these operating systems.
02:40As of the time of this recording, it's very easy to install PHP 5.3 with Apache,
02:46but if you want to move to the newest version of PHP, 5.4, you'll find it takes a
02:51little bit more work.
02:53In this version of the course, I primarily focus on PHP 5.3 and offer some tips
02:58about 5.4 where they're available.
03:01One of the advantages of installing these software products individually is that
03:06if you need to upgrade one element, you won't need to uninstall the others.
03:10When you use the integrated software bundles I'll describe next, most of the
03:14time you'll find that in order to change your software, you have to uninstall
03:18everything and reinstall everything.
03:21Individual components give you more control.
03:23The advantage though of the AMP software bundles is that they're very easy to
03:28install and get started with.
03:30All of the software bundles that I'll describe here are free to download
03:34and easy to set up.
03:36If you're a Windows developer, you might consider WampServer, and if you're a Mac
03:41developer, you might look at MAMP.
03:43These are the software bundles that I typically use in my courses that involve
03:48PHP, MySQL and Apache.
03:50There are other bundles available too and they each have their own benefits.
03:56These three software bundles are available for multiple operating systems;
04:01Windows, Mac and Linux.
04:02There is XAMPP, spelled with an X, BitNami and Zend Server Community Edition.
04:10When you choose an AMP distribution, it's good to know some of the benefits of each.
04:14For example WampServer and XAMPP both install by default using the standard
04:20ports for Apache and MySQL.
04:23If you're working with MySQL and PHP, using Dreamweaver for example, you'll find
04:28that you have to use port 3306 with MySQL and if you use an alternative port,
04:34Dreamweaver won't be able to connect to that database.
04:37WampServer and XAMPP set up these software products exactly how Dreamweaver
04:41would expect them to be set up and also how they are set up in a production
04:45environment typically.
04:46MAMP, on the other hand, by default uses alternative ports.
04:52This gives you the advantage on Mac of being able to run side-by-side with the
04:56versions of Apache and PHP that are included in the operating system.
05:00But MAMP also makes it very easy to reset to the standard ports, port 80 and 3306.
05:07BitNami has distributions that include common PHP applications such as
05:13WordPress, Drupal, and Joomla! and many others.
05:16If your goal is to get started with one of these content management systems,
05:20you'll find that BitNami provides a very easy road forward.
05:24Also BitNami, uniquely among all of these bundles as of the time of this
05:28recording, offers versions that integrate PHP 5.4.
05:33These versions, again at this moment, are available only for development and
05:38not for production.
05:39But if you want to get started with PHP 5.4, BitNami offers a very easy path.
05:45One of the most important things to consider is that you can only have one copy
05:50of each software product running on each port at a time.
05:55You could have more than one copy of MySQL running, but only one can listen on
05:59port 3306, and only one copy of Apache can be listening on port 80.
06:04So it's a good idea to choose one approach and then stick with that approach on
06:10each individual computer.
06:13Particularly on Windows, installing both an AMP bundle and the separate
06:17components can cause a lot of problems.
06:20You'll find that sometimes you will get DLL conflicts, different versions of a
06:25particular component that conflict with each other and prevent one or both of
06:30these software components from starting up at all.
06:33So on Windows, install the separate components or an AMP bundle, but not both.
06:39And finally, if you install two AMP bundles on a single computer, make sure you
06:44deactivate the first before you start up the second.
06:48There are some combinations of these software bundles that can be installed
06:51side-by-side, for example MAMP and the included components of Mac OS X as long as
06:57they're listening on different ports.
06:59But if you want to make sure that your software is going to run the first time
07:03every time, install one of these bundles and stick with that bundle and don't
07:08install anything else on that particular computer.
Collapse this transcript
Using the exercise files
00:00The exercise files that accompany this course, Installing Apache, MySQL, and PHP,
00:06are free for everybody.
00:08They include some custom files that I've created and also one open source
00:12software package that I'm redistributing
00:14that should make it easier to test and manage your software.
00:18The files include a PHP file called phpinfo.php that you can use to test
00:24your PHP installation;
00:26a text file that you can use to uninstall MySQL on Mac OS X; an SQL file that
00:32creates a new database with structure and data in MySQL; and then in the
00:38phpmyadmin folder, the actual phpmyadmin software.
00:43This is a free, open source web application that you can use to manage your MySQL
00:47databases, and it works on both Mac and Windows.
00:51And to go with that software, I've created some brief configuration files that
00:56should make it easier to get up and running with the software on your choice
00:59of operating system.
01:02So again, the exercise files are completely free and you don't need a Premium
01:05membership to use them.
Collapse this transcript
What's new in this update
00:00This video series, installing Apache, MySQL and PHP, is regularly updated to
00:06keep up with changes in the software it covers.
00:10Here's what's new in this course update which was done in mid-2012.
00:15First, I've updated coverage of WampServer.
00:18WampServer is one of the most popular AMP stacks for windows.
00:22The ownership and management of WampServer has changed and their web site was redesigned.
00:27So I've rerecorded the videos that show how to navigate that web site.
00:32But the underlying software is pretty much the same;
00:35you install it in management in the same way as before.
00:38So if you are already using WampServer and you don't need to go get a new
00:42version or reinstall it, the new coverage probably won't apply to you.
00:47If you're brand new to WampServer though, the newly recorded videos should match
00:51what you see on their web site.
00:53I've also added coverage of BitNami AMP distributions.
00:56BitNami is an organization that creates and distributes AMP
01:00installation packages.
01:02They support Windows, OS X and Linux, and uniquely, BitNami AMP distributions
01:09are available with common CMS or content management system applications already bundled.
01:15For example if your goal is to get started with WordPress, Drupal, Joomla!
01:21or many other open source PHP-based applications, you might find a distribution
01:26on the BitNami web site that already has this software bundled and ready to use.
01:32Finally, I show how to work with AMP on Windows 8.
01:35Windows 8 has moved over to IPv6, a new system for assigning IP addresses.
01:42For developers working with Apache, this has an interesting effect.
01:46The term localhost, a DNS name that points to your local computer, has
01:51traditionally always equated to an IP address of 127.0.0.1.
01:58On computers that use IPv6, localhost now equals a string of ::1. When you're
02:05working with the Apache HTTP server, this can cause some issues with your
02:10configuration files.
02:11I'd show how to handle this in Apache specifically with WampServer, which when
02:17you install it on the current version of Windows 8, starts off broken.
02:20I'll show you the underlying problem and how to fix it in the Apache
02:25configuration files.
02:27So that's a look at what's new in this mid-2012 update to installing
02:31Apache, MySQL and PHP.
02:34As always with this course, if you see things that have changed in the software
02:38we cover, let us know and we'll do our best to update the content to match what
02:43the software looks like in the real world.
Collapse this transcript
1. Installing Separate Components on Windows
Installing Apache on Windows
00:00The Apache HTTP server is the most popular HTTP server on the planet.
00:06It's completely free and is available from the HTTP Server Project
00:10at httpd.apache.org.
00:14To download the application, click the "from a mirror" link, under Download.
00:19The most stable version as of this release is 2.2.19. Scroll down in the page
00:25and you'll see that there are a number of available distributions.
00:29There are source versions for both Unix and Win32, and Binary versions for Win32
00:34and for NetWare. I recommend using the Win32 Binary, including OpenSSL.
00:40I've already downloaded this installer to my desktop, and here's the installer.
00:46I'll double-click it to start it, and then I'll walk through the initial prompts.
00:51I'll read through the license agreement, and if I accept its terms, I'll
00:55indicate so, and click Next.
00:58There is some informational text here about the server, and I'll click Next
01:02again, and I'll come to the Server Information screen.
01:06You're running the Apache server purely for local development, so set your
01:10Network Domain and your Server Name to localhost.
01:15You can set the Email Address to anything you like.
01:18I'll use the fake email address that's listed on the screen.
01:22You can install the HTTP server in one of two modes.
01:26The recommended approach is to install it as a Windows service, listening on
01:29port 80, the default http port.
01:33When you install as a service the server will stay running, even after you
01:37log out, as long as the computer stays on.
01:40If you install for the current user, it will run as an application and if you
01:44log out, it will turn off.
01:45Also, it will be listening on a custom port, port 8080.
01:50I'll use the Recommended mode, port 80 as a service, and click Next.
01:55I'll leave the Setup Type set to Typical and click Next again, and that brings
01:59me to the Destination Folder screen.
02:01The default location is under the Program files, or on 64-bit Windows,
02:06Program Files (x86) folder.
02:09I recommend placing the Apache server in a folder without any spaces or
02:13other special characters.
02:14I'll click Change, and I'll set the folder name to simply C:\apache, and click OK.
02:23I'll click Next, and I'll click Install.
02:27It'll take a few moments, and then you might see a user account control dialog pop up.
02:33If you do see this, just click Yes.
02:37Then the files are copied over to your hard disk and the server is set up as a Windows service.
02:44You might see some little errors fly by as the installation proceeds. That's okay.
02:49I'll show you how to resolve those errors in a moment.
02:51Once the installation wizard is completed, click Finish.
02:56It might take a few moments for the installation wizard to close;
02:59there's still some work being done in the background. Just be patient, and
03:03when it closes, you'll be ready to test your server.
03:09Now to test the server, go into any browser. Type in the URL http://localhost/.
03:18You should see this very simple HTML page, with the text "It works!"
03:23Now I'll show you where your web documents are stored.
03:27The document root folder for the Apache server is under C://apache/--
03:32that's the root folder where I installed the software--and then there is a
03:36subfolder named htdocs.
03:38This folder contains a single file, index.html.
03:42I'll open it with a text editor, and show that it has that very simple text of "It works!"
03:49And that's what you're seeing in the browser.
03:51This folder is where you'll place all of your HTML, PHP, graphics files, and
03:57other assets that you want to be able to retrieve from a browser.
04:01Now, it's also important to know where to turn the Apache server on and off.
04:06You do this through the Windows Services Console.
04:09I'll go to the Windows Control panel from the Start menu.
04:12I'll click into Search Control panel and type, "services."
04:17And then I'll click on View local services.
04:20If you're working on Windows XP, you should see the administrative tools link at
04:24the top of the Control panel list, and you'll find the Services Console there.
04:29Here is the Apache 2.2 Service.
04:33Notice it's set up as an automatic startup service and that it's already started.
04:39You can stop the service by clicking the Stop button, and then you can click
04:43the Start button again.
04:45So that's the basics.
04:47There are some troubleshooting tips I'll share in a separate video, but if
04:50you've gotten this far, you are ready to install PHP and integrate it with
04:54your Apache server.
Collapse this transcript
Starting Apache from the command line
00:00When you're working with the Windows service of the Apache web server, it's
00:04sometimes hard to see errors that pop up when the web server is started.
00:08I'm looking at the Services Control panel, and I'll show you that if I stop
00:12the service and then restart it again, it appears that it's starting without any problems.
00:18But when you first install the Apache web server, there is one additional
00:21configuration you might want to make, and the only way that you will know this
00:24condition exists is if you start Apache from the command line instead.
00:28So I'm going to stop the Apache service, and then I'll open up a command window.
00:34I'll go to the Start menu and type "cmd" and press Enter.
00:39Then I'll change to the Apache bin directory with "cd\apache\bin."
00:49Here's a listing of the files that are in this directory.
00:51The most important one is here, httpd.exe.
00:56That's the executable for the HTTP server.
01:00So I will clear the screen, and then I'll try to start the Apache server from the
01:04command line with the command httpd.
01:08I see this error, "could not reliably determine the server," et cetera, and it
01:13shows the dynamically generated IP address that was assigned by this
01:17computer's DHCP server.
01:19Now, you might not see this on your system, but if you do, I'll show you how to resolve it.
01:23I will press Ctrl+C to stop the server at the command line.
01:27That brings back the prompt.
01:29Now, I'm going to make an edit to the Apache configuration file.
01:32I will go to Windows Explorer and navigate to the Apache conf directory, and
01:38I'll open the file httpd.conf in a text editor.
01:41I will search for the phrase "localhost." Here it is!
01:47This is a line that explicitly configures your Apache server to use a particular
01:51host name and a particular port.
01:53I am just going to remove the pound sign, or hash mark, at the beginning of the line.
01:57That's commenting this option out right now.
02:00I'll save my changes by pressing Ctrl+S and then closing the text editor, I will
02:06return to the command window, and once again I'll start the httpd command.
02:11This time it starts up without any errors.
02:14To fully test it, I will go to a browser, and I'll type in http://localhost, and
02:23I get the homepage from the Apache server.
02:27So now that I know the Apache server is configured correctly,
02:29I'll return to the command window,
02:31I will Stop the server by pressing Ctrl+C, and I'll close the command window.
02:37Then I'll return to the Services Control panel and I'll restart the service.
02:42Now I know that the Apache HTTP server is correctly configured.
02:46You can use this option of starting Apache from the command line, so you can
02:50see any errors that are generated more clearly, than are available in the
02:54Services Control panel.
Collapse this transcript
Installing PHP with Apache on Windows
00:00After installing the Apache HTTP server, the next step is to install PHP.
00:06You can download the free installer for PHP for Windows from the web
00:10site windows.php.net.
00:13From the homepage, click the Downloads link.
00:17As of this recording, the most recent version of PHP listed here was 5.3.8,
00:22but that's not the version I'm going to show you how to install, and I'll show you why.
00:27Notice that there are two versions listed, both labeled VC9.
00:32And then look at the text over on the left labeled Which version do I choose?
00:36It explains that if you're using the HTTP server from Apache.org, which we are,
00:41we need versions of PHP labeled VC6, not VC9.
00:46As of this recording, the last version that qualifies was 5.3.5, and it's not
00:52listed on this screen.
00:53So here's what you do.
00:55Scroll all the way down to the bottom of the page and look over on the
00:57left, under Archives.
00:59Click the archives link, scroll down and locate the 5.3.5 installers.
01:05Specifically, you're looking for this file, php-5.3.5-Win32-VC6-x86.msi.
01:15Now, I've already downloaded the file to my Desktop,
01:18so I'll close the browser and then I'll double-click the installer to start it up.
01:24I'll walkthrough the various prompts, including reading through the license
01:28agreement, and then if I accept the terms, I'll click the appropriate
01:31controls and click Next.
01:34On the Destination Folder screen, I'll indicate where I want to install PHP.
01:38As with Apache, I recommend installing PHP to a folder that doesn't have any
01:43spaces or special characters in its name.
01:46I'll change this simply to C:\php, lowercase. Then I'll click Next again.
01:53On the Web Server Setup screen, I'm asked which version of the web server
01:57connector I want to use.
01:59I'll choose the first one, Apache 2.2.x Module.
02:04There are others that can work, but this is the best for the particular version
02:08of Apache that I installed. And I'll click Next.
02:11Now I'll indicate where my Apache HTTP configuration directory is.
02:16I'll browse, I'll navigate to the C:
02:19drive route, and I'll go to apache\conf.
02:25That's where the httpd.conf file is stored.
02:30I'll verify the folder name and then click OK, and then I'll click Next again.
02:36And now I've made all of my selections. I'll click Next, and I'll click Install.
02:41It will take a few minutes to copy the files over to your hard disk and
02:46integrate PHP with your HTTP server.
02:50Along the way, you might see this User Account Control dialog. If so, click Yes.
02:58Once the wizard is complete, click Finish.
03:01Now, the installation isn't quite done.
03:03There is one manual change that you have to make.
03:06I'll show you how to make a critical change to the Apache configuration file.
03:12I'll go to Windows Explorer, to the C:\apache\conf folder, and I'll open
03:20httpd.conf in a text editor.
03:24Now, I'll scroll all the way down to the bottom of the file.
03:27Down at the bottom, you should find these four lines of text,
03:31two comments wrapped around two declarations.
03:35The PHPIniDir and the LoadModule declarations need to be explicitly edited to
03:41indicate the location of your PHP installation.
03:44Place the cursor between the quotes after PHPIniDir and type "c:/php."
03:51Make sure you're using a forward slash and not a backslash, as you might
03:56normally do in Windows.
03:58Now place the cursor after the opening quote before the DLL and type "c:/php/",
04:06once again being sure to use forward slashes and not backslashes.
04:11Save your changes and close the editor.
04:13Go back to the Control panel, to the Services console.
04:16Locate your Apache2.2 service and click the Restart Service button.
04:22You'll see the Service Control dialog pop up and indicate that it's stopping and
04:27then restarting Apache.
04:29Now, close all your windows and open up a browser.
04:34To fully test whether PHP is working, you'll need a simple PHP file.
04:39I've provided that file in the Free Exercise Files folder.
04:43Go into the Free Exercise Files and locate this file, phpinfo.php.
04:48I'll show you its contents.
04:50So this file contains a very simple PHP command, phpinfo.
04:56It's wrapped inside the PHP beginning and ending tokens.
04:59When you execute phpinfo, the PHP server dumps a whole bunch of technical
05:04information in HTML out to the browser.
05:07So I'm going to copy this file and then I'll navigate my C:\apache\htdocs, and
05:15I'll paste it into place by pressing Ctrl+V. Now to test my HTTP server, I'll go
05:21back to that browser, and I'll type in http://localhost/phpinfo.php.
05:32When I press Return, the phpinfo command dumps all sorts of useful
05:36information out to my browser.
05:39Most importantly, the loaded configuration file is listed here.
05:43This tells you which PHP file is being used to configure your installation.
05:48And I'll show you one setting that I typically use in the php.ini file.
05:52I'll go to Windows Explorer again and this time go to C:\php, and then I'll
05:59open up php.ini in a text editor.
06:04I'm going to search for the following string, display_errors.
06:10The first instance of that string that I find is documentation.
06:13That's not what I was looking for.
06:15I'll search again, and this time I get to this configuration, display_errors = Off.
06:22I'm going to change that from Off to On.
06:26That means that when errors occur in my PHP pages, the errors will be displayed
06:30right there in the browser, at the place where the error occurred.
06:34And this will mean that I don't have to go look at the log files to diagnose
06:38problems in my PHP pages.
06:40This is a very important setting that you should turn on when you're doing local development,
06:45but you might want to turn off when you deploy your application to a production server.
06:49I'll save the change.
06:51I'll once again go back to the control panel and restart my server.
06:57I'll go back to the browser and press Ctrl+R to refresh and verify that PHP is
07:03still operating correctly.
07:05So if you've gone through all those steps and you can see the phpinfo output,
07:09you're in great shape to move to the next step, installing MySQL.
Collapse this transcript
Installing MySQL on Windows
00:00The native installer for MySQL is available from the mysql.com website at
00:05www.mysql.com/downloads.
00:10On this screen, click MySQL Community Server and then decide which installer
00:17you're going to use.
00:19You need to know whether you're running 32 or 64 bit Windows.
00:23You need to choose the installer for your version of Windows.
00:27To find out, go to the Control Panel and from there click System and Security
00:33and then click System.
00:35On this screen, you will see the System type listed as either 64 or 32 bits.
00:40I am using the 64-bit version of Windows, so that's the version of MySQL that I'll select.
00:46I'll choose the x86, 64-bit MSI installer.
00:53Now I've already downloaded that to my desktop, so I'll double-click it to start,
00:57then I'll click Run and walk through the prompts.
01:02At the License screen I'll read through the license and if I agree with the
01:05terms I'll check the checkbox and click Next.
01:10I'll choose the Typical setup type and then click Install.
01:14Along the way, you might see a User Account Control dialog box.
01:19If you see it, click Yes.
01:22You'll also see file is being copied over to your hard disk and you might see a
01:26couple of billboards or advertisements for various products sold by Oracle and
01:30MySQL. If you see these advertisements just click Next again.
01:36The server installation happens in two phases.
01:39During this initial phase, the files are copied over to your hard disk.
01:44You'll then be asked to configure the server in a second phase.
01:49When you see the message that the initial setup is done, keep this option
01:53selected, Launch the MySQL Instance Configuration Wizard, and click Finish.
01:59If you see another User Account Control dialog, click Yes and that will take you
02:03to the Instance Configuration Wizard. Click Next, and on this screen if this is
02:10your only copy of MySQL choose Standard Configuration. Click Next again.
02:16On this screen, check the checkbox to include the bin directory in the Windows path.
02:22This will allow you to run the MySQL executables from the command line,
02:26regardless of where you are on the hard disk. Click Next again.
02:30On this screen select and type in a root user password.
02:35I'll use a very simple password of just password.
02:39Type it in twice and click Next and then finally click Execute.
02:46It'll take a few more moments to complete the installation.
02:49A configuration file is created called my.ini and this screen shows you where
02:54that file is located on disk.
02:57Then your Windows service will be started and the Security settings applied.
03:02When you see this message your installation is complete.
03:05Click Finish and then go to the Windows Control Panel.
03:11From there go to the Services Panel, I've typed in services and then clicked
03:16View local services, and then scroll down to the M's and you should see the new
03:22MySQL service listed and its Status should be set to Started.
03:28Now if you have any trouble, try troubleshooting using tips from MySQL.
03:33Here is a webpage that's provided in the MySQL documentation.
03:40You can search for this page by going to Google and typing in Troubleshoot MySQL Windows.
03:46You'll find multiple versions. Make sure that you're looking at the reference
03:50manual for your version of MySQL.
03:54In this document it talks about certain problems that can occur the first
03:57time you install MySQL.
04:00Including security problems having to do with the folder program data, which is
04:04created as a hidden folder under the C drive root on Windows 7.
04:09If you're working on Windows Vista or an older version of Windows, this data
04:13folder might be located under the Windows Installation folder.
04:17Regardless of which version of Windows you're working on, if you have trouble,
04:20read through this document and follow its steps.
04:23On a fresh version of Windows, you should be able to troubleshoot and get your
04:27version of MySQL started before you start doing your local development.
Collapse this transcript
Installing phpMyAdmin on Windows
00:00phpMyAdmin is a very popular free web application that can be used to manage
00:06your MySQL databases.
00:08You can download the most recent version of phpMyAdmin from this web site, www.phpmyadmin.net.
00:16But I've included a copy of phpMyAdmin in the exercise files that come with this
00:21course, and I'll show you how to install that version.
00:25I'll go to the Free Exercise Files folder and double-click into the phpmyadmin folder.
00:31You'll find a zip there, including phpMyAdmin 3.4.3.2.
00:36And there's also a configuration file, one for Windows and one for Mac OS X.
00:41To install phpMyAdmin, first extract the contents of the zip file.
00:46I'll extract the contents of the zip file directly to the desktop, by
00:50right-clicking and choosing Extract All and then Extract.
00:53Now you can use any zip utility you like,
00:57WinZip or anything else, because this file is in simple zip format.
01:03Go to the extracted folder which has the same name as the zip file and
01:07double-click into it.
01:08You'll find another folder there of the same name.
01:12And then drag that folder into your document root folder.
01:16I'll open a new copy of Windows Explorer.
01:19I'll position this one over on the right and the original one over on the left.
01:24In the right window, I'll go to C:\apache\htdocs, and then I'll take this folder
01:30and drag it over to the right one.
01:33I'm done with that copy of Windows Explorer, so I'll close it.
01:37And now for this folder, I'll rename it.
01:39I'll press F2 and call it simply phpmyadmin, all lowercase.
01:45That'll just make it easier to call from the browser.
01:49That's basically it.
01:50phpMyAdmin has been installed,
01:53but there are a couple of configurations that I recommend.
01:56Let's first test it from a browser.
01:58I'll go to my browser and I'll type in http://localhost/phpmyadmin.
02:10Notice that I see a listing of files.
02:12This is because of a configuration that needs to be made in the Apache web
02:16server, not in PHP or in phpMyAdmin.
02:21So as I have before, I'm going to open up the httpd.conf file in a text editor.
02:27I'll go to C:\apache\conf, and I'll open the file.
02:34Now I'm going to search for the string index.html.
02:39This takes me to an option named DirectoryIndex.
02:43By default, the Apache server is set up to default to HTML files.
02:48I want, instead, to default to PHP files, because that's the kind of file I'm
02:53primarily going to be using.
02:55So I'll change this from index.html to index.php.
03:01I'll save and close the file.
03:04I'll return to my Services control panel and restart the server.
03:11Now I'll go back to the browser and refresh.
03:14And this time, phpMyAdmin appears, showing me a login screen.
03:19I'll type my username and my password.
03:22This is the MySQL password that you set up when you installed MySQL in a previous video.
03:30I'll click the Go button and that opens up phpMyAdmin.
03:36Now, it's also possible to configure phpMyAdmin to open automatically, using your
03:41username and password from a configuration file.
03:45Here's how you do that.
03:47I'll close all these other windows; I'm pretty much done with those.
03:50Then I'll go to the Free Exercise Files, to the phpmyadmin folder again.
03:56I've provided a file that configures phpMyAdmin on Windows, using a minimal set
04:02of configuration options.
04:05I'll open the file in a text editor and show you that there are four options.
04:08The first three have to do with the login option.
04:12I put in the username and the password explicitly.
04:15Again, this is the username and password for MySQL.
04:19And I've set auth_type to a value of config.
04:22You should change the password setting to your password.
04:25So if you used something else, something more secure, change it here.
04:30I've also added an option called AllowUserDropDatabase and set it to a value of true.
04:36This will make sure that you as an administrator can drop or delete databases
04:41from your MySQL database.
04:43By default, phpMyAdmin doesn't let you do that.
04:46Now here's how I'll use this file.
04:49I'll go back to Windows Explorer, and I'll copy this file to the clipboard.
04:54Then I'll go to C:\apache\htdocs\ phpmyadmin, and I'll paste the file into place,
05:02pressing Ctrl+V. Now I need to rename the file.
05:06I'll press F2 and I'll change the file name to config.inc.php.
05:15That's all you have to do.
05:17Now, I'll make sure that I've closed all my browser windows so that I'm logging
05:21in for the first time again.
05:23I'll open a new browser window, and once again I'll go to
05:26http://localhost/phpmyadmin.
05:33If you see the login screen initially, that's okay;
05:36press Ctrl+R to refresh the page, and this will reload the application.
05:41And this time it loads without you having to type in your username and password again.
05:45This sort of configuration is great for local development.
05:49It is, however, not particularly secure, so I only recommend using this minimal
05:53configuration on the local development copy of this application.
05:57If you want to put phpMyAdmin on your production server, read through the
06:01phpMyAdmin documentation for their recommendations on the best settings to use.
06:07There's also a file here called config.sample.inc.php, which you can learn a lot from.
06:13It has a lot of common configurations that you can use in your own copy of phpMyAdmin.
06:19But with this smaller configuration file that I've provided, you have everything
06:23you need to do local development and manage your local databases.
Collapse this transcript
2. Installing Separate Components on Mac OS X
Activating Apache on Leopard and Snow Leopard
00:00If you're working with Mac OS X and want to use separate components for your AMP
00:04stack, you're ahead of the game, because Mac OS X includes both Apache and PHP
00:10in its default installation.
00:12You just have to know how to turn them on.
00:15First, I'll show you how to turn on Apache.
00:17Go to the Apple menu and choose System Preferences. Then from there, click
00:23Sharing, which you'll find under Internet & Wireless.
00:26Mac OS X refers to the Apache web server as Web Sharing, which you can activate
00:32by simply checking the check mark.
00:35When you activate Web Sharing, you're turning the built-in Apache web Server on.
00:39On this screen it will show you the IP address of your computer.
00:44Assuming that your computer is getting its IP address dynamically using an
00:48architecture known as DHCP, this IP address will be different on every computer.
00:53Notice that there are two possible links.
00:56The bottom one is a web site for the entire computer; the top one though, is a
01:01web site for the currently logged-in user.
01:03I'm logged in on my Mac as a user named LDC, for lynda.com, and so my
01:09personal web site is under the local IP address / then a tilde character,
01:15and then the username.
01:17Now you don't have to use this dynamically generated address.
01:20If you click it, you'll see the default web page.
01:23Now, I'm recording on version 10.6 of Mac OS X. That's Snow Leopard.
01:29If you're using another version of Mac OS X, the web page may look different,
01:34but you should still see a confirmation that the Apache web server is running.
01:38But you can actually get to exactly the same web page and exactly the same
01:42location on your disk by using the local IP address that's common to all
01:47computers, 127.0.0.1.
01:52Once again, I'm referring to the LDC folder using the tilde as a prefix, and that
01:58takes me to the same place.
02:00Yet another alternative is to use the word localhost.
02:04The localhost DNS name always points to the IP address 127.0.0.1.
02:13Typically, when you're doing local development, you should either use localhost
02:18or the IP address, the 127.0.0.1 address.
02:22Your instructors will typically use these addresses, rather than anything
02:25that's dynamically generated, and that will make sure that you're using the
02:30same address on your computers as they did on theirs and that it's working
02:34the same for everybody.
02:36Now I'll show you where these files are stored.
02:37I'll go to Finder, to my personal directory, LDC. Under there, go to a folder named Sites.
02:48You'll find this, file index.html, and an images folder containing a few basic graphics.
02:55I'll double-click index.html to open it in a browser, and you'll see that it
03:00looks exactly the same.
03:02So this folder, the Sites folder under your home directory, is what's known
03:06through Apache as the document root.
03:10Each user that's logged in to a particular Mac has their own personal document
03:14root, and then there is also a computer-wide document root, which is stored on
03:18your Mac hard disk under /library/web server/documents.
03:25So once you know how easy it is to turn your Apache web server on, you'll be
03:28ready to go onto the next step, activating PHP,
03:32and I'll show you how to do that in the next video.
Collapse this transcript
Activating Apache on Lion
00:00Just as with older versions of the Mac operating system, version 10.7, or Lion,
00:06includes the Apache HTTP server.
00:09It's up to you to activate, or turn it on.
00:13I'll go to the Apple menu and choose System Preferences.
00:17You can also get here through the Dock.
00:19On this screen, go to the Internet & Wireless section and choose Sharing.
00:23Mac OS X refers to the Apache HTTP service as Web Sharing.
00:29Go to that category, and you'll see that it's turned off by default.
00:33To turn it on, just check the check box; it's that simple.
00:37Now to test your Apache server, go to the second link on this screen.
00:42It will either show an IP address, as it does here, or your computer name. Click the link.
00:49If everything is working correctly you should see the page, "It works!"
00:53This is a very simple homepage that's provided with the Apache server.
00:58Now it might not work on your system, especially if it's showing the computer
01:01name instead of an IP address, but here is the URL that always works.
01:07Go up to the address bar and change either the IP address or the computer name,
01:11whichever showed up, to this IP address, 127.0.0.1.
01:19Then press Return and now you should definitely see this page.
01:23The IP address that starts with 127 is a globally used IP address that refers
01:29to the local computer.
01:31It's used on Mac, Windows, Linux, and other operating systems.
01:35There's a name that goes with it.
01:37Instead of 127.0.0.1, you can instead use localhost and that should work as well.
01:44Now let's take a look at where these files are stored on your Mac.
01:48Now let's return to the Sharing dialog.
01:50Lion has added a couple of useful buttons to this interface.
01:54There is a button above called Create Personal Website Folder--
01:57I'll show you that in a moment--and this one Open Computer Website Folder.
02:02When you click the button it takes you to your document root folder on your Mac hard disk.
02:08You'll find that it has this file, index.html, and some graphic files that might
02:12or might not be showing up on your screen.
02:15There's also this folder, postgresql. This is new to Lion.
02:20It contains documentation for the PostgreSQL database, and it's not relevant to
02:25what we're doing here, so I won't talk about it anymore.
02:29I'm going to show you exactly where this folder is located on the disk.
02:32I'll make sure that I've deselected all the files and folders in this screen.
02:37Then I'll go to the Finder menu and choose View > Show Path Bar.
02:42Down at the bottom of the screen, that will show that this folder is under
02:45Library > WebServer > Documents.
02:49If you're using the Apache HTTP server, this is where you put your HTML, graphics,
02:55PHP files, and other files that you want to be able to browse from the browser.
03:00We call it the document root folder.
03:03On Mac OS X there is also a concept of a personal document root folder.
03:08Each user can have a folder named Sites, with an uppercase S, which is also
03:13accessible from a browser.
03:15I'll go back to my Sharing dialog and show you that there's a link here with the
03:18original URL and the syntax ampersand and then username.
03:24My username is simply lyndadotcom, so this would refer to the Sites folder
03:28under my home directory.
03:31I'll click the link and you'll see that there's a message saying I don't have
03:34permission to access that folder, and here's why.
03:38On Lion that folder does not exist by default for new users.
03:44I'll go back to Finder and go to the menu and choose Go > Home, and I'll show
03:50you that there is no sites folder here.
03:52There is the Desktop, the Documents, and so on, but that folder has not been created yet.
03:58So, going back to Sharing, this is where this button comes into play.
04:03I'll click Create Personal Website Folder and then Open Personal Website Folder,
04:10and I'll see that I have a file called index.html and a folder named images.
04:15And looking at the path bar at the bottom, I'll see that I can now do have a
04:19Sites folder in my lyndadotcom home folder.
04:23I'll double-click lyndadotcom and show you that that's where the folder has been created.
04:28Going back to Sharing, I'll click that link again, and this time I see files that
04:34have been created for me.
04:36Now just like the computer's own web site, you can either use the URL that's
04:41generated here or you can use 127.0.0.1 or you can also use localhost.
04:53So if you're able to access both the computer's web site, which is in that
04:57Library > WebServer > Documents folder, and your personal web site, which is
05:02in the Sites folder, under your home directory, you have Apache completely
05:06set up and ready to use.
Collapse this transcript
Activating Apache on Mountain Lion
00:00In OS X 10.8, Mountain Lion, Apple has made a big change in how you use Apache and PHP.
00:08Apache is still included with the operating system, but the user interface has
00:13changed significantly.
00:15If you go up to System Preferences and from there, to Sharing, you won't find Web
00:20Sharing listed anywhere; it's been completely removed from the user interface.
00:25As I said, Apache is still there, but you have to turn it on and off from the
00:30command line, and I'll show you how to do that here.
00:32I'll close the System Preferences application, and I'll go to Terminal.
00:38Terminal is your command line access to your Mac.
00:41To start Apache, use this command.
00:44Start off with sudo. R=That stands for super user do. Then type in the name of
00:50the Apache Control Application, apachectl, and after a space, start.
00:58That's saying start the Apache server.
01:01Because you're executing the command as a super user, you're challenged for your
01:05administrative password.
01:07I'll type in the password, press Return, and that should start up the server.
01:13To test it I'll go to a browser and I'll type in "localhost," and I should get
01:21back the response "It works," a very simple HTML page that's already in the
01:26document root of your Apache server.
01:29Now, if you don't see this right away, be patient.
01:32On many initial installations of Mountain Lion, it takes a long time to resolve
01:37the DNS name localhost.
01:39It equates to 127.0.0.1 if you're using IPv4 and to another string if you're
01:48using IPv6, but this introduction of IPv6 in Mountain Lion has caused an issue
01:55with how long it might take to resolve the URL in your browser.
02:00You can wait a minute or two and it will almost certainly work, but that's
02:05frustrating when you're doing development.
02:07So I'll show you a workaround if you're experiencing this slowness.
02:12You can simply disable IPv6 on your computer and as long as you don't need this
02:17new feature for the rest of your work, you'll be able to get to localhost
02:21instantly, right after starting up the server.
02:24To do this, I'll go back to Terminal.
02:28I'll start by using a command called networksetup.
02:31I'll type "networksetup" and then "-listallnetworkservices."
02:38Make sure you spell this exactly as you see it here: all lowercase and all one word.
02:44That should give you a list of the services on your computer.
02:47Your list might be different from mine.
02:50You're looking for a service named Ethernet, and if you see it there, as you
02:54should, that's the thing that's slowing you down.
02:58Here is how you turn off IPv6. Just as you did when you were starting up
03:03Apache, start with sudo.
03:06Then once again type "networksetup" and then "setv6off" and after another space, the
03:14name of the service, Ethernet.
03:17You're saying disable IPv6 completely.
03:20Don't make it a part of my operating system.
03:23I'll press Return, and I shouldn't get back any response, but I also shouldn't
03:28get back any errors.
03:30I'm going to restart Apache.
03:33I'll type in "clear" to clear the screen.
03:36Then I'll once again use sudo apachectl, then stop.
03:43Then I'll press the up arrow, and I'll press it a few times until I get back to
03:47my start command, and I'll press Return again.
03:50I can then go back to the browser and refresh with Command+R. Regardless of
03:56whether you were seeing the slowdown before, you should now see the default page instantly.
04:01The location of your document root folder is exactly the same as it was in
04:06previous versions of OS X. To get to it, go to Finder.
04:11Then go to the Menu and choose Go > Go to Folder.
04:16From there, type in "/Library/WebServer/Documents" and it is case-sensitive.
04:27That should take you to the folder that contains your HTML page and any other
04:31assets. And if you're creating your own website or your own PHP-based web
04:36application, this is where you would put your files.
04:40These are the steps you follow to configure the Apache server when you only need
04:45a single web server for your entire machine.
04:48But when you're doing development, you'll frequently want to use a personal site
04:52folder, and I'll show you how to configure that in the next video.
Collapse this transcript
Configuring personal site folders on Mountain Lion
00:00In versions of OS X prior to 10.8, Mountain Lion, Apple had a feature that let
00:06you easily create a personal website folder, a subfolder of your home folder
00:11named sites, and you could put your own website assets there and address it as
00:16its own distinct website.
00:19As I showed previously, the user interface for controlling Apache is gone in
00:23Mountain Lion, but you can do the same thing in Mountain Lion manually, by just
00:28following a few steps in Terminal and in a text editor.
00:32The first step is to create the folder.
00:35I'll go to Finder and I'll start in the Desktop folder.
00:39Then I'll hold down the Command key and press the up arrow and that takes me to
00:44my home folder, and this is where I'll create a new sites folder.
00:49I'll right click in the folder and select New Folder and name it Sites, with an
00:54uppercase S. You can name this anything you want--it doesn't have to be sites--
01:00but I'm going to show you how to imitate the behavior of previous versions of
01:04the operating system.
01:05So the Sites folder has been created, and now we just need to add a little bit of content.
01:11I'm going to use TextWrangler to create a very simple HTML file.
01:16You can use any text editor that you prefer, such as Dreamweaver or Coda.
01:21I'll go to Spotlight and type in TextWrangler and open the application.
01:26I'll start by creating a pair of HTML tags, then a pair of body tags, and then
01:33within the body, a pair of h1s.
01:36Within the h1 tags, I'll type in "This is my personal website."
01:43Then I'll save this file and I'll place it in that new Sites folder.
01:47Just as I did before, I'll go to my Home folder, which is named lyndadotcom on my computer.
01:54From there, I'll go down to the Sites folder and then I'll name the file index.html.
02:01So now I have a simple default web page.
02:04The next step is to add a configuration to Apache that tells Apache when the
02:10user types in a URL that ends with tilde and then my username, it means to
02:16open the files in this folder.
02:18I'll close down TextWrangler and I'll now go to Terminal.
02:23In Terminal, I'll switch to the users folder underneath the Apache
02:27installation folder.
02:29I'll type cd /etcetera/apache2/users/.
02:38This users folder will contain one configuration file for each user who has
02:43a personal website.
02:45If this is a brand-new installation of Mountain Lion and you list out all the
02:49files with LS, you should see that there aren't any configuration files there.
02:54If you upgraded Mountain Lion from an older version of OS X, you might see
02:59conf files for each user on the computer.
03:02Your job is to create a configuration file for your user profile.
03:07To do this, we'll use the editor that's included with OS X. It's named pico.
03:14Its user interface is a little clunky, but it knows how to create system and hidden files.
03:19Start by typing sudo for super-user do, then pico, then your username, and this
03:27should match the name of your home folder.
03:30I'll type lyndadotcom.
03:33Then follow that with the file extension .conf.
03:37You're saying, create this file and open it in the pico editor.
03:41When you press Return, you might be prompted for your administrative password.
03:45If so, type it in and press Return, and that opens your new file in the editor.
03:51Now I'll type in some text.
03:54As you will follow along, typing in exactly as I'm doing here.
03:57It is case-sensitive.
04:00I'll start with the directory tag.
04:02I start with the beginning tag token, a less then character, then the word
04:06Directory with an uppercase D. Next is the physical name of your Sites folder.
04:12That's the folder you just created.
04:14After a double quote, start with /Users, then after another slash
04:20the name of your home folder.
04:22Again, for me that will be lyndadotcom.
04:25Then after another slash, the name of the subfolder you created, and I created a
04:30subfolder called Sites, then close the tag.
04:35On the next line, you'll start adding some keywords that tell Apache how this
04:40folder should be treated.
04:42Start with Options, then Indexes, and then MultiViews.
04:49On the next line type in AllowOverride All. It looks like this.
04:56On the following line type in Order, with an uppercase O, then in all
05:00lowercase allow,deny.
05:03That means that when evaluating permissions for this folder, Apache should give
05:08precedence to allow commands.
05:11Then on the next line type in, Allow from all, and finally close the directory tag.
05:18I'll press Return one more time, and I'll review what I've typed.
05:23Make sure that you type this in exactly right.
05:26You can always come back and edit it again later by executing that same pico
05:30command in Terminal, but it's best if you get it right the first time.
05:34Once you have confirmed that you've type everything correctly, press Ctrl+X to
05:40exit pico, type in Y for Yes, and then Return to confirm the file name.
05:46When you come back to the command line, type ls and once again list the files
05:51and you should see that the configuration file has been created.
05:55Now restart Apache. Type in sudo apachectl restart.
06:02You won't see any response, but that relaunches the Apache server, and it will
06:07read that configuration file and be ready to respond.
06:11Let's review all the steps that we followed.
06:14We created the Sites folder and we populated it with some content.
06:18In Terminal, we added a configuration file for the current username and
06:23then restarted Apache.
06:25Now I'll test my personal folder.
06:29I'll go to my browser, and I'll type in the URL http://localhost and then the
06:36tilde character and my username.
06:39And when I press Return, I see my personal webpage is displayed with the
06:43content that I typed in.
06:45You can follow this process for any user on the computer, creating configuration
06:50files that create exactly the same personal website as was created more
06:55automatically on older versions of OS X.
Collapse this transcript
Activating PHP on Mac OS X
00:00Mac OS X includes PHP, along with the Apache HTTP server.
00:06Version 10.5 of the operating system, Leopard, includes PHP 5.2, while versions
00:1310.6, Snow Leopard, and 10.7, Lion, both include PHP 5.3.
00:19PHP isn't enabled by default, though.
00:21You have to activate it.
00:23I'll show you how to do that.
00:24First, go to your Web Sharing dialog and for the moment, turn Web Sharing off.
00:30Then you'll go to Terminal and open a command window.
00:33If you've never used Terminal before, you can find it easily by going to
00:37Spotlight in the upper-right corner, typing "terminal," and pressing Return.
00:42Now to make it easy to get to Terminal in the future, go to your Dock,
00:46right-click on Terminal and choose Options > Keep in Dock.
00:52Now, you're going to edit the HTTP configuration file.
00:56I'm going to use an editor that's included with Mac OS X called pico, or P-I-C-O.
01:01I'll start with the command "sudo."
01:04That stands for superuser do and allows me to do anything I want on this computer.
01:10Then I'll type pico the name of the editor and then the location and name of the
01:14HTTP configuration file, /etc/apache2/httpd.conf.
01:25Make sure you type this in all lowercase. Press Return.
01:31If you're prompted for your administrative password, type it in and press Return,
01:36and that will open the HTTP configuration file in pico.
01:40Now locate the line of code that activates PHP.
01:44Pico is completely a keyboard-oriented editor;
01:48you won't be able to use the mouse.
01:49You'll see keyboard shortcuts listed at the bottom.
01:52Press Ctrl+W for where is, or find, type "php," and press Return.
01:59This should take you to a LoadModule command that references PHP 5.
02:05Notice there's a hash mark, or pound sign, at the beginning of the line.
02:08That's a comment, and it's deactivating PHP right now.
02:13Using your arrow keys, move over to the left and then backspace over the pound
02:17sign, and now PHP is activated.
02:20Exit and save the file.
02:22Press Ctrl+X, Y for yes, and Return.
02:28And now you've made the required change to the configuration file.
02:32The next step is to create a PHP initialization file.
02:36This goes into a folder called /private/etc, and this file needs to be named php.ini.
02:44It doesn't already exist on your system, but there is a beginning file
02:48there that you can copy.
02:50Type the following command to change to the right directory:
02:53cd /private/etc. And then list all files that start with the letters php.
03:04Type "ls php*" and press Return.
03:10You should see a file named php.ini.default.
03:14You might see other files there, depending on how your computer was configured,
03:18but the default file is the only one you need.
03:21Now you'll copy that and create the new file named php.ini.
03:26Type "sudo cp" for copy, and type the name of the existing file, "php.ini.default"
03:36and then after a space, the name of the file you want to create "php.ini" and press Return.
03:43Once again list the php files with ls php* and you should see the new file is there.
03:50Now, that's all you have to do, but if you want to make any changes to the ini
03:55file, you can again use the pico editor or any text editor that you prefer.
04:00I'll type "sudo pico ./php.ini."
04:05Now I'm going to make one change that I always make to my PHP configuration when
04:10I'm doing local development.
04:13If I encounter a PHP error, I want the error to print in the HTML that's
04:17returned to the browser.
04:19This capability is turned off by default.
04:22To find it, press Ctrl+W and type "display_errors" and press Return.
04:30The first time you search you'll get to some documentation.
04:33Press Ctrl+W and Return again and now you get to the actual configuration.
04:39Change the value of display_errors from Off to On.
04:44Once again, exit and save.
04:46Press Ctrl+X, Y for yes, and Return.
04:50Now, you'll turn Apache back on again.
04:53Go back to your Sharing dialog and check Web Sharing and Apache should start correctly.
04:59Now to test PHP, I've provided a file in the Free Exercise Files that you can
05:04copy to your web root.
05:07Go to the Free Exercise Files and copy the file phpinfo.ini to the clipboard.
05:13Then navigate to your root folder.
05:16That's under the Macintosh root folder, Library/WebServer/Documents, and
05:25paste the file into that location.
05:29To test this, go to any browser and then type in the following URL,
05:33"http://localhost/phpinfo.php."
05:41If everything is working correctly, you should see this generated HTML page,
05:46which tells you which version of PHP you're using and, as you scroll down, all
05:50sorts of other important information about your PHP environment.
05:54One of the most important bits of information you should see is the name and
05:58location of your loaded configuration file, which is /private/etc/php.ini when
06:06you're using the versions of Apache and PHP that are included with Mac OS X.
Collapse this transcript
Installing MySQL on Mac OS X
00:00Unlike the Apache Web Server and PHP, the MySQL database is not installed by
00:06default with Mac OS X. So if you want to use the database you have to download
00:10it and install it yourself.
00:12You can get the free Community Server edition of MySQL by going to
00:16www.mysql.com/downloads and click on MySQL Community Server.
00:24Scroll down the screen and you'll see that there are a number of different
00:27installers for Mac OS X. There are different compression versions. There are
00:32TAR Archives and DMG Archives, but there are also 32 and 64 bit versions of the database.
00:40You should install the version that matches your version of Mac OS X.
00:44Now if you have a relatively new Mac with an Intel chip, you're almost
00:49certainly running 64-bit Mac, but if you want to make absolutely sure here's a little trick.
00:54Go to Terminal and then type in the following command.
00:59Type it in exactly shown here.
01:01It is case-sensitive.
01:02ioreg -l -p IODeviceTree, then the pipe character, which is
01:13a character on the same key as the backslash, then grep space and
01:19finally firmware-abi.
01:23You're executing a command that will tell you which version of Mac OS X you're running.
01:28Press Return. If the output includes the string EFI64 then you're running 64-bit Mac.
01:36I'm running 64-bit Mac OS X, so I'm going to use this version of the database server.
01:41Mac OS X version 10.6 (x86, 64-bit) DMG archive. If you're running an older
01:48version of Mac OS X such as Leopard use the appropriate version of MySQL.
01:54Now I've already downloaded this DMG files to my desktop and I'll run
01:57through the installation.
01:58I double-click the DMG file to open it and I'll find three installers, one for
02:05the database, one for an item that will go into the System Preferences pane, and
02:10one for something called MySQL startup item.
02:14I'm going to install the first two.
02:16I'll start with the database.
02:18I'll double-click the DMG file and click Continue. I click Continue again I'll
02:25review the license agreement and if I agree with this terms I'll click Continue
02:28and then agree. I'll click Continue and click Install.
02:35If prompted for a password, type your administrative password in.
02:40It takes just a few minutes to write the files to your disk and execute a few
02:44simple configurations.
02:51After the installation is complete, close the application and go back to your virtual disk.
02:57Next I'll install the item for the System Preferences. I will double-click and
03:03then at the prompt I'll choose Install for all users of this computer and then
03:07click Install. When prompted out once again typing my administrator password.
03:14This adds an item to the System Preferences pane that will let you easily stop
03:18and start your MySQL server.
03:21I'll click the Start button, once again typing my password ,and after a few
03:27moments MySQL server is running.
03:29If I later want to stop the server I just click the button again.
03:35To get back to this panel, go to System Preferences item on the Apple menu and
03:41you'll find MySQL in the Other section of the System Preferences.
03:46So that's to look at how to determine which version of MySQL you should install,
03:50how to get and install the software from MySQL, and then how to use the System
03:55Preferences pane to stop and start the server.
Collapse this transcript
Setting the root user password
00:00When you first install MySQL on Mac OS X using the native binaries from MySQL,
00:07the root user is created with a blank password.
00:10You typically want to create a password for the root user before starting on
00:14your development work.
00:16Here is how you can do it.
00:17First make sure that MySQL is running. I'll go to the System Preferences pane
00:23and click Start MySQL Server. If prompted type in your administrator password.
00:28Then I'll go to Terminal.
00:32In Terminal I'll switch to the directory that contains the MySQL binaries.
00:37I'll type cd /USR/local/mysql/bin.
00:47I'll type ls and show you that there's a list of available applications.
00:52Now to confirm that the root user can be used without a password, type in this
00:57command, ./mysql -u root.
01:05That's the name of the root user.
01:07When you press return it should start the MySQL monitor without prompting you
01:12for a database password.
01:14If you see this then you are confirming that the root user is set up without a
01:18password. Type exit and then press Return to exit the monitor.
01:24Here is the command to set a root user.
01:26password. ./mysqladmin -u root.
01:34That means I'm using the SQL administrative tool as the root user.
01:39Then I'll type password and the string that I want to set the password to.
01:45I'll type in the string password. I'll press Return and now the root user
01:51password has been set.
01:53If you then try to enter the MySQL monitor again, access will be denied.
01:58I'll type in ./mysql -u root and I get an access denied message.
02:06So now that you've installed MySQL and configured the root user with a password,
02:10you're ready to start using the database from your selected MySQL client.
02:15In the last video of this chapter, I'll show you how to install and use an
02:19application from MySQL called MySQL Workbench that will let you connect to your
02:25server and create some simple data.
Collapse this transcript
Installing phpMyAdmin on Mac OS X
00:00There are many great free tools to allow you to manage your MySQL databases, but one
00:05of the simplest and easiest to get started with is phpMyAdmin, a free web
00:10application which you can download from www.phpmyadmin.net.
00:16You can either go to this site and download the most recent version, or you
00:20can use the version that I've included in the free exercise files that come with this course.
00:25To use that version, go to the Free Exercise Files, to phpMyAdmin.
00:31The entire web application is in this very small zip file.
00:35Extract the zip file, then move the resulting folder, phpMyAdmin with the version
00:41number, to your Apache document root.
00:44To do that, I'll press Command+N to create a new finder window,
00:49I'll go to the Mac hard drive root, then to Library/WebServer/Documents, and
00:55then I'm going to drag this folder into the document root.
01:00After it's been dragged into place, I'll rename it with simply phpmyadmin.
01:06You can name the folder anything you want, but by naming it simply phpmyadmin
01:11all lowercase, it will make it very easy to access from the web browser.
01:15Now let's check a few things before we try to fire it up.
01:18Go to your System Preferences dialog and from there, to the MySQL pane, and make
01:25sure that MySQL is running.
01:26Then you can close that dialog.
01:29You're done with that for now.
01:31Then go to a browser and navigate to the URL http://localhost/phpmyadmin.
01:41You should see this login dialog.
01:43If you try to log in right now, it's not going to work, even if you type in the
01:47correct username and password for your MySQL Installation.
01:51I will type in type in "root" and then my password and click Go, and I will see an
01:57error saying, "Cannot log in to the MySQL Server."
02:00There's also a very obscure message down at the bottom:
02:03"The mcrypt extension is missing. Please check your PHP configuration."
02:07All of these problems can be easily solved with a very small configuration file,
02:11and I have provided the most minimal version of this configuration file, again,
02:15in the free exercise files.
02:17I'll go to the Free Exercise Files, to the phpmyadmin folder, and I am going to
02:23use this file, config.inc_MAC.php.
02:29Now I want to leave the original file in place, so I'm going to copy that to
02:33the clipboard, then I'll go back to my document root folder, to phpmyadmin, and
02:40I will paste by pressing Command+V. Now I'm going to rename the file, taking out the _MAC.
02:48I'll click on the file once and then press Return and then remove _MAC, so that
02:54the actual name of the file is config.inc.php.
03:00Next, I am going to edit it.
03:02You can use any text editor for this purpose. And I'll show you that this file
03:07has some basic settings in it.
03:09The socket configuration on the fourth line is referring to something called
03:13a socket file, which is created automatically by MySQL when it starts up on your system.
03:19On Mac OS X, this file is in the TMP folder.
03:23You shouldn't have to change that line at all.
03:25The next line refers to the username.
03:27I am using root, the administrative user that's created automatically when you
03:32install MySQL--and again, you can use that for local development.
03:37Next is the password.
03:38I have simply password, but you should change this to reflect your MySQL password.
03:44The next item, auth_type, changes to a different authentication model named
03:48config, and this will remove that confusing mcrypt error that you saw earlier.
03:53And finally, there's a configuration item named AllowUserDropDatabase.
03:58By default, you as an individual user won't be able to drop or delete your own databases.
04:04I've reset that value to true.
04:06So if you need to make changes to the user and password, go ahead and do it
04:09and save your changes, but leave everything else alone and then close your text editor.
04:15Now to test go back to your browser, once again type localhost/admin, and when it
04:21opens, it may show the same screen, but press Command+R to refresh the screen
04:26and now phpMyAdmin should open correctly.
04:30To test and make sure that you can create and delete databases, I have
04:34provided an SQL file.
04:36First click Databases and create a new database.
04:40I'm going to name it explorecalifornia and click Create.
04:46Then over on the left I will click on my new database.
04:49Now, I'm going to import some structure and data from an SQL file.
04:55I'll click Import at the top,
04:57choose File, then in my free exercise files folder, I will choose
05:02explorecalifornia.sql.
05:04I will scroll down to the bottom and click Go, and I should see the message that
05:10the database has been imported correctly.
05:13I can go over to the left side and see the database in my list, and if the
05:17database is selected, I should be able to browse the data.
05:21Now test that you can drop the database.
05:24Up at the top of the screen, I will go to the list of my pages, and I'll click
05:28explorecalifornia, and this takes me back to the database page.
05:32I will go to the Operations screen.
05:36I'll take a look over on the left, and I should see a link that allows me to drop the database.
05:42This is the tool that was enabled by that additional configuration in
05:45the configuration file.
05:47I will click the link and confirm and now the database is gone.
05:53So that's how you get started with phpMyAdmin.
05:56I should caution that the minimal configuration that I provided is perfectly
06:00suitable for local development.
06:02If you want to put phpMyAdmin on your production PHP server--that is, a server
06:07that's available to the public--check the phpMyAdmin documentation for the
06:12recommended configuration for a more secure installation.
Collapse this transcript
Uninstalling MySQL on Mac OS X
00:00If you use one of the software bundles MAMP or ZAMP on Mac OS X, the process of
00:06uninstalling is very easy.
00:07You just shut down the servers and drag the application to the trash.
00:11But if you're using the individual MySQL installation, it's more complex.
00:16Here are the steps.
00:18First, make sure that MySQL is shut down.
00:21You can go to the System Preferences pane.
00:23You'll find the MySQL pane in the other section at the bottom and then just
00:28click Stop MySQL Server.
00:31Alternatively, you can do it from the command line.
00:34You can go into Terminal and then I'll change to the directory containing
00:39the MySQL binaries.
00:40I will type cd /usr/local/mysql/bin.
00:49Then I'll type this command, ./mysqladmin -u root. Then if I've added an
00:59administrator password I would type in -p.
01:02I don't have administrator password right now so I'll leave it out.
01:05And then I'll type shutdown.
01:09Then I'll go back to the System Preferences pane and it'll show that
01:12MySQL Server has stopped.
01:15Now you're ready to check the startup status of MySQL.
01:19Notice that I have the option to Automatically Start MySQL on Startup checked.
01:24This will be reflected in an entry in a text file on your system and you'll
01:28need to edit that file manually.
01:31You can do this through any text editor that can handle hidden files.
01:35As I've indicated in other videos, I use TextWrangler.
01:39In TextWrangler, I'll select File > Open Hidden, then I'll navigate to a folder
01:46named etc under the disk root.
01:50Within that folder, I will find the file named hostconfig and I'll open it.
01:56If you see this configuration line, MYSQLCOM=YES,
02:01that's the line that's controlling the startup setting for MySQL as your system starts up.
02:07Delete the line manually.
02:09I will press the Delete key.
02:11I will be prompted by TextWrangler to unlock the file and then the line will be removed.
02:17Then when I try to save the file, I'll be prompted for my
02:20administrator password.
02:23I'll confirm and the change is made and then I will close the file.
02:29Finally, you will remove all of the elements of MySQL from the Terminal command line.
02:35Once again go back to Terminal and I'm going to need to execute a number of commands.
02:41To make this a little bit easier, I've included a text file in the free
02:44Exercise Files folder.
02:46It's named MySQLUninstalledOnMac.txt.
02:50I will open this file up in my Text Editor and then I'll copy all of the text to the clipboard.
02:57Here is what these lines of code do.
03:01The first two lines of code remove the MySQL folder and all of its contents.
03:05There are two entries because there is both the actual physical folder, which
03:10starts with the string MySQL, and a symbolic link or alias that points to that folder.
03:15You're removing both of them.
03:17You're also removing the Startup Item and the Preferences pane.
03:21The Receipts folder contains various elements of MySQL that are created as it is
03:26running, and the my.cnf file is the configuration file.
03:30So I have copied all of these commands over to the clipboard. Then I will go to Terminal again.
03:38Before I try to execute the commands, I'll make sure that I've been
03:41authenticated in the current Terminal session.
03:43I will type in sudo, the pseudo or sudo command which stands for Super User Do.
03:51And then I'll type in just a single dot.
03:53If I'm prompted for my administrator password, I'll type it in and then I'll
03:57see the output command not found.
04:00I didn't actually try to run a command there.
04:03I used the dot to just trigger the authentication request.
04:07But now I am authenticated for this session and I can easily execute a whole
04:12bunch of commands without being prompted for the password again.
04:15I'll do this by pressing Command+V to paste in all those commands I copied
04:20from the text file.
04:22The last command will hang on the line.
04:24I will need to press Return once to execute that.
04:27There are certain files and directories that might or might not exist,
04:31depending on which elements of the installation process you followed and how
04:35you've used your copy of MySQL.
04:37But once you've executed all of these commands, MySQL will have been completely
04:42removed from your system.
04:44You can now safely go on and use any of the other MySQL implementations, such as
04:49the distributions included in MAMP or ZAMP for Mac OS X.
Collapse this transcript
3. Installing WampServer on Windows
Installing WampServer
00:00WampServer is one of the easiest and fastest to install of the available
00:05software bundles for windows.
00:07You can download WampServer from www.wampserver.com/en.
00:13Make sure you include the en subfolder at the end of the URL otherwise you might
00:17be downloading the French version.
00:20From the Home screen click Download.
00:23You'll see five different versions available;
00:25three for 64-bit Windows and two for 32-bit Windows.
00:30If you're not sure which version of Windows you're running, you can go to the
00:33Control panel and from there click System and Security and then System.
00:40Check the System type.
00:42My computer is running 64-bit Windows.
00:44So I'll download a version of WampServer to match.
00:48As of the time of this recording, there were three different packages for 64-bit Windows.
00:54The first listed in the top- left has Apache 2.2 and PHP 5.3.
01:00On the bottom-left there is a version that includes Apache 2.2 and PHP 5.4, and
01:06in the top-right one that has Apache 2.4 and PHP 5.4.
01:12If you're working with a production environment that you'll be uploading a web
01:15site to, you should download a version of WampServer that most closely matches
01:19that production environment.
01:21And if you're not sure which version you'll be working with, check with your
01:25Network Administrator or ISP.
01:27I'm going to download the latest and greatest, 64-bit Windows with Apache 2.4 and PHP 5.4.
01:36I've already downloaded the installer to my Desktop,
01:39and I'll double-click to fire it up.
01:42Along the way, if you see any security dialogs or User Account Control dialogs,
01:47click Yes or OK to continue.
01:50I'll click Run from this initial dialog box, click Yes on the User Account
01:54Control dialog box and that takes me to the initial Setup screen.
01:59On this screen, I see the exact versions of all the software that I'll be installing.
02:04I'll click Next, read through the License Agreement and then if I agree with
02:08it, click Next again.
02:11Now I'll indicate where I want to install WampServer.
02:14The default folder for WampServer is c:\wamp.
02:19I'll accept that default and click Next.
02:22I'll select Create a Desktop Icon.
02:24This will create a Desktop icon that I can use to restart WampServer later.
02:30I'll click Next and then I'll click Install.
02:34It'll take a few minutes to copy all of the files over to your hard disk. Be patient.
02:39There's a lot of files to copy over.
02:42This Windows Explorer dialog is asking you for the location of your default web browser.
02:48You can browse and select a specific web browser that you'll use to open
02:52phpMyAdmin and the WampServer homepage or you can just use your system web
02:57browser by clicking Open.
03:00On this screen, you are asked for your PHP mail parameters.
03:04If you have an SMTP server, that is an email server, through which you want your
03:08PHP server to send mail, you can add the URL here and add your email address.
03:15If you're not going to set that up, you can just click Next.
03:18The installation is now complete.
03:20I'll leave the option checked to Launch WampServer immediately and click Finish.
03:25And then if prompted by User Account Control, I'll click Yes again.
03:30You get to the WampServer admin menu by going down to the system tray.
03:34When WampServer starts up, you should see a system tray icon.
03:38And if you don't see it here check your hidden icons, it might appear there.
03:43Click the icon and you'll see the WampServer admin menu appear.
03:48To test your WampServer installation, choose Localhost.
03:52That will open up a web browser and it should open up the WampServer homepage.
03:58If you have trouble opening the homepage, click your browser's Stop button and
04:02then your Refresh button and see if it appears.
04:05The WampServer homepage will show you the currently installed versions of
04:09Apache, PHP and MySQL.
04:12We'll have a couple of links to valuable tools.
04:16Click phpinfo() and that will take you to a page that shows you all the details
04:22of your PHP installation.
04:24It'll show you which PHP version you're running and most importantly, the
04:28location and name of your Loaded Configuration File.
04:32You might need to make changes there, so make a note of it.
04:36I'll click the Back button and then I'll go to phpMyAdmin.
04:41phpMyAdmin is the web-based application you can use to manage your MySQL databases.
04:48If phpMyAdmin opens, then you're successfully running Apache, PHP and MySQL.
04:56You can also test your database installation by using a file that's delivered
05:00with your WampServer installation.
05:02I'll minimize my browser and then go to Windows Explorer,
05:06and go to the new folder C:wamp, and from there to a folder named www.
05:14This is your document root folder, the folder where you'll place your
05:18PHP-based web site files.
05:20I'm going to take a look at this file, testmysql.php.
05:25Again, this file is delivered automatically with WampServer.
05:29I'll open it in a text editor.
05:31I'm using Notepad, but you can use any text editor.
05:35I'll change the hostname, the database user and the database password.
05:40The defaults will be localhost for the database URL, root for the username and a
05:47blank string for the password.
05:48These are the default settings.
05:51You can change them if you like.
05:54I'll save and close this file.
05:56Then I'll go back to my browser and I'll change the URL to
06:00http://localhost/testmysql.php.
06:07If you see Connection OK, everything is working fine.
06:10You can explore other aspects of the WampServer interface by going again to the
06:15Admin menu and taking a look at some of the many options that are available, to
06:20stop, restart and otherwise configure your WampServer installation.
Collapse this transcript
Managing WampServer
00:00The WampServer administrative menu, which you reach from the system icon,
00:04gives you the ability to manage your WampServer installation, once it's up and running.
00:08You can start and stop the services, either all at once or individually.
00:13To stop and start Apache, go to the Apache folder, to Service, and then you can
00:19stop or restart the service from here.
00:22You can also go to MySQL, to Service, and you can stop and start the
00:26service from here as well.
00:28You'll see options under both Apache and MySQL to Install Service.
00:33If you install these, it means that you're allowing these services to run, even
00:37when the WampServer application isn't running.
00:40You might do that if you are using WampServer for production, instead of for
00:44local development, but I do recommend that if you're going to do that, that you
00:48reconfigure Apache and MySQL for better security than is delivered in the
00:53default installation.
00:56You can also stop and start All services,
00:59that is, Apache and MySQL, at the same time.
01:02Go under Quick Admin and make the appropriate choice.
01:06As I showed in the earlier video, you can get to the www directory.
01:10That's your document root.
01:12And in WampServer 2.1, by default, there are two files there: index.php and testmysql.php.
01:21And, as I already showed, you can also go to phpMyAdmin.
01:26This is the web application that you can use to manage your MySQL databases.
01:33WampServer 2.1 includes two new tools under the Debug menu:
01:38they're named Client XDebug and webGrind.
01:42Learning how to use these tools is outside the scope of this course, but they're
01:45worth taking a look at.
01:48So that's a look at what's available in the WampServer administrative menu.
01:52You can easily get to your document root folder, to phpMyAdmin,
01:56you can stop and start your services, and you can open various files
02:00directly from the menu.
Collapse this transcript
Defining directory aliases through WampServer
00:00The Apache web server supports the concept of aliases.
00:04An alias is a virtual directory that points to a location on disk and you can
00:08address the alias through the web browser and retrieve documents from the
00:12disk in this manner.
00:14The directories that you set up as aliases don't need to be under the document
00:17root folder. You can make them independent on your disk.
00:21To demonstrate this I've created a folder under my CDrive root named mywebapp
00:27and I've created a simple file called index.php under it.
00:32I'll open the file in Notepad and show you that it executes a simple PHP
00:36command, php.info, which outputs the current PHP configuration to the screen.
00:42Now this directory is not under my WAMP folder, that's the document root, and I
00:46want to make the entire directory accessible through the browser.
00:49So I'll go to the WampServer administrative menu and choose Apache > Alias
00:55directories > Add an alias.
00:59That opens up a command-line window.
01:01I'll type in the name of the alias that I want to create.
01:04It's going to appear to the browser as a directory under the localhost or 127.0.0.1 root.
01:13I'll name my alias webapp, then I'm asked to type in the full location of the
01:18physical directory, using forward slashes.
01:21I'll type c:/mywebapp/ and press Enter.
01:28That creates the alias.
01:30Next, I'll go to the WampServer administrative menu and I'll make sure that the
01:35Apache web server is restarted by checking the color of the gauge.
01:39If it's not white, just open up the menu and choose Restart All Services.
01:44Once the gauge shows you that all the services have restarted, you can go to a
01:49browser and test the new alias.
01:51I'll type in http://localhost/webapp/ index.php and if the alias is working
02:03correctly, I should see the output of the PHP info command, showing me my PHP configuration.
02:10If you don't see this display, if for example you see the actual PHP code or
02:16you're prompted to download the PHP file to your hard disk, that means Apache
02:20didn't successfully restart.
02:23You should stop Apache completely and then restart and if all else fails reboot
02:28your computer to continue onward.
02:31You can add as many aliases to your Apache configuration as you like.
02:35The advantage of an alias is that the folder containing your web files is
02:39outside the WAMP document root and therefore outside the WAMP installation root folder.
02:44You can manage your files much more easily, but you can also add whatever PHP files,
02:49HTML files, image files, and other web assets you need to construct your web site.
Collapse this transcript
Changing software versions with WampServer add-ons
00:00WampServer makes it very easy to switch between different versions of each of
00:05its software components.
00:07Let's say for example that you are working with the legacy PHP and MySQL
00:10application and the production environment for this application uses an older
00:15version of MySQL, MySQL 5.1.
00:19When you installed WampServer, you got the most recent version of MySQL, 5.5,
00:24but you can install the two versions side-by-side and you can do this with all
00:29three components: Apache, PHP and MySQL.
00:34These are called add-ons.
00:36To get to the add-ons, go to the WampServer Downloads Screen and scroll down a
00:40bit and you'll see links for PHP, Apache and MySQL add-ons.
00:46There's also a link for Beta add-ons, but these are actually full installers of WampServer.
00:51There is one there, for example, that let's you install the most recent version
00:55of PHP 5.4 as a Beta.
00:59I'm going to demonstrate multiple versions of MySQL.
01:02But again you can do this with Apache and PHP as well.
01:06I'll click the link, Download MySQL Addons, and I'll see that there are versions
01:12of MySQL going all the way back to 4.1.2.
01:16I'll choose the most recent 5.1 distribution, 5.1.41.
01:22I'll click the link and download the software to my Desktop.
01:27Now I've already downloaded it and here it is.
01:30To run the add-on installer, just double-click it and run through all of the
01:35dialogs, including any User Account Control dialogs that might appear.
01:40The add-on installers don't have any options.
01:43So just follow through the dialogs and complete the installation.
01:48You don't have to stop WampServer before you do the installation.
01:52If any restarts are required, the installer will handle it for you.
01:56Let's see what happened.
01:58I'll go to the system tray and click the WampServer icon and then I'll go
02:02to MySQL > Version.
02:05I'll see that I have both the newest version, the one that was originally
02:09installed and the older version.
02:12I'll go to the Localhost link and show that I'm running MySQL version 5.5.2.
02:19I'll close the browser and go back to the system tray icon to the Admin menu to
02:24MySQL > Version and I'll choose 5.1.41.
02:30You'll see the color of the icon change momentarily as the WampServer
02:34installation restarts.
02:36Then, I'll go to the icon and I'll choose Localhost again and I'll see MySQL
02:41version has changed to 5.1.
02:44So now I can easily switch back and forth between the versions and work with the
02:48version of MySQL that I need for my current application.
02:52You can do this with Apache and PHP as well.
02:56Switching between the different versions of the individual components as needed,
03:00you might find certain incompatibilities.
03:03For example one version of PHP might not work with another version of Apache,
03:08but you can always return to your original versions to get a working AMP Stack.
Collapse this transcript
4. Installing MAMP on Mac OS X
Installing MAMP
00:00The MAMP software bundle represents one of the easiest ways to get started with
00:04Apache, MySQL, and PHP on Mac OS X. You can download the MAMP software from this
00:11web site, www.mamp.info.
00:14Make sure you're looking at the English version of the page.
00:18You'll see that there are two versions of MAMP: one simply called MAMP and
00:22the other, MAMP PRO.
00:23When you download the software, you'll actually be downloading both at the same time.
00:28Go to the Downloads link, then click the Download link here, and follow the rest
00:33of the prompts to download the software to your hard disk.
00:36You'll see that the software is downloaded in a zip archive file.
00:40When you extract that archive file you end up with this installer package, MAMP.pkg.
00:46To run the installer, double-click, follow through the prompts, including
00:51reading the license agreement and if you agree, click Continue and Agree,
00:56and then click Install.
00:58There are no other options for the MAMP installation.
01:02When prompted, type your administrative password.
01:05The installation should take just a few minutes, as the files are written to your
01:10hard disk and placed into your Applications folder.
01:14Once the installation is complete, click Close. Then, in Finder, go to your
01:18Applications folder.
01:20You'll see in your Applications folder that there are two folders named MAMP and MAMP PRO.
01:26You'll be using the free edition, MAMP, and you won't need MAMP PRO at all.
01:31You can keep it in the Applications folder if you want. Or, if you prefer, you can
01:35move it to the trash.
01:37Now before I start up MAMP, I'm going to make sure that any copies of Apache or
01:42MySQL that are already on my Mac are turned off.
01:45I'll go to my System Preferences. From there I'll go to Sharing, and I'll make
01:51sure that Web Sharing is unchecked.
01:54That will make sure that the version of Apache that's included with Mac OS X is
01:58off and won't conflict with the version that's included with MAMP.
02:03If you've installed a native version of MySQL, check that as well.
02:07I'll go to the MySQL pane and make sure that it's stopped.
02:12Now I'm ready to fire up MAMP.
02:15I'll go into the MAMP folder and show you that there is a MAMP application. And
02:20there is also a critical folder named htdocs.
02:24The MAMP htdocs folder is your web document root, where you place your HTML,
02:29graphics, PHP, and other files that you want to call from a web browser.
02:35I'll go back to the MAMP folder and double-click MAMP to start it up.
02:40When you first start up MAMP, the server should fire up automatically, and once
02:44they start, this homepage should appear.
02:48Notice that this home screen tells you that you're running MySQL on port 8889.
02:54That's a nonstandard port, and I'll show you how to change that in another video.
02:59You can also see, up here in the URL bar, that you're running Apache on port 8888,
03:04again, a nonstandard port.
03:06MAMP comes out of the box this way to allow you to run these copies of Apache
03:11and MySQL at the same time as the versions that are included with Mac OS X, but
03:16if you prefer, you can use the standard settings as well.
03:19To verify that your database is working, click on phpMyAdmin and you should see
03:24this listing, showing you that phpMyAdmin is working and connecting to your MySQL database.
03:30So that's all there is to it.
03:32MAMP is incredibly simple to install.
03:35There are other options that you can use, and I'll show you some of those
03:38options in other videos.
Collapse this transcript
Configuring Apache and MySQL server ports
00:00When you install MAMP Pro, Apache and MySQL are installed with custom ports.
00:05You can find out what the current ports are by going to the Start page.
00:10If you look at the web address that's used to open the start page, you'll see the
00:13port number 8888 that Apache is listening on.
00:17And down below in the MySQL section of the homepage you'll see the port being
00:21used by MySQL. It defaults to 8889.
00:26Those ports are not standard and in fact if you're going to try to use your AMP
00:29stack with the certain products such as Dreamweaver, they aren't going to work.
00:34So before you continue with your development work you should change the ports
00:38back to the standards of port 80 for Apache and port 3306 for MySQL.
00:43Here is how you do it.
00:45Go to the MAMP application and click Preferences. In the Preferences
00:50dialog click Ports.
00:52Click the button labeled Set to default Apache and MySQL ports.
00:56You'll see Apache changes to 80 and MySQL to 3306, click OK.
01:03Both Apache and MySQL will restart and you might be prompted for your
01:07administrator password.
01:10Type it in and then watch the indicators to see whether the servers are starting
01:14up correctly. They should be set to green.
01:17Once the servers have started, open the start page again.
01:21This time you should see that the Apache server is listening on the standard
01:25port 80, indicated by localhost without a port number, and MySQL should be
01:30listening on Port 3306.
01:33Once you've change to the standard ports for Apache and MySQL, you'll be able to
01:37work with your MAMP installation.
01:39If you have any troubles changing ports, try this. Go to the Preferences and
01:44click Reset MAMP ports and click OK and that will cause the service to restart
01:49using the custom ports that MAMP sets up.
01:52Then go back to Preferences again and once again set to the default Apache and MySQL ports.
01:58You sometimes have to give MAMP a little bit of a nudge to get it to keep
02:02the proper settings.
02:04And once again you can always confirm that the servers are using the correct
02:07settings by going to the start page and looking at the web address and the
02:11MySQL configuration.
Collapse this transcript
Managing MAMP
00:00The MAMP user interface offers a number of options for managing your Apache,
00:05MySQL, and PHP installation.
00:07All of the options are available under Preferences.
00:11Here are some valuable tasks you can accomplish.
00:14By default the MAMP servers, Apache and MySQL, start when you start the MAMP
00:19application and shutdown when you quit MAMP.
00:23You can tell the servers to stay alive and keep on responding to requests
00:27even if you've closed the MAMP application, by deselecting the option stop
00:32servers when quitting MAMP.
00:33I'll make that change and click OK.
00:35You'll see that there's some work being done in the background.
00:38Then I'll click Open start page and show you the URL that's used to navigate to the homepage.
00:44localhost/MAMP/language=English.
00:48Now, I'll close the browser and I will quit the MAMP application.
00:52I'll reopen the browser and using a bookmark that I've already setup, I'll go
00:57back to that location and you'll see that the servers are still alive.
01:02This feature is useful if you want to keep your MAMP servers up and running but
01:07don't want to keep the MAMP administrator interface open.
01:10To change that setting, reopen the MAMP application.
01:14If the start page opens, close it.
01:17Once again go to Preferences and reselect the option.
01:22Another option you might want to change is that by default when you open the
01:25MAMP application, it always opens the start page.
01:28If you don't need that feature, you can turn it off.
01:32I've already described the use of the ports settings,
01:35how to change the standard ports for Apache and MySQL.
01:39Under PHP, you'll find that you can switch between PHP versions.
01:44You can choose 5.3 or 5.2.
01:48The Apache section of the Preferences dialog has a single option:
01:52changing the document root folder.
01:54The default location is a folder named htdocs under /Applications/MAMP.
02:01If you want to use another folder anywhere on your hard disk, just click Select,
02:05browse, and choose the folder you want to use.
02:08When you're done, click OK.
02:10Apache will restart.
02:12You might be prompted for your password and then the content of your new
02:16document root folder will be served from Apache.
02:20So that's a look at some of the most commonly used features of the MAMP
02:23administrative interface.
02:25Other than these features, you're using a basic version of Apache and MySQL,
02:30and anything else you know how to do with those servers can be done with the MAMP environment.
Collapse this transcript
5. Installing XAMPP
Installing XAMPP for Windows
00:00The software bundle spelled X-A-M-P- P is pronounced either ZAMPP or XAMPP
00:06depending on who is talking.
00:07You can download XAMPP for free from www.apachefriends.org/en/xampp.html.
00:17There are versions available for Linux, Windows, Mac OS X, and Solaris, and XAMPP
00:23is completely free and does not require any registration.
00:27To use XAMPP for Windows, click on the XAMPP for Windows link and then download
00:32the software, using this link under Download.
00:36Unlike WampServer, another software bundle for Windows which includes both a
00:4032-bit and a 64-bit distribution, XAMPP is only available in a 32-bit
00:46installation, but that's okay.
00:48It should work fine on any edition of Windows XP, Windows Vista, or Windows 7.
00:55I've downloaded the XAMPP installer to my desktop, and I will start it
00:58by double-clicking.
01:00If I am prompted with a User Account Control dialog, I will click Yes.
01:04I will choose my language, English, read through any informational notes that
01:08pop up, and then continue through the prompts.
01:12Here I am asked where I want to install XAMPP.
01:15The default is c:\xampp.
01:18You can choose any other folder, but I strongly recommend choosing a folder
01:22name without any spaces.
01:24I will use the default and click Next.
01:28On this screen, I accept all of the defaults, including creating a desktop icon
01:32to easily start XAMPP up and creating a folder in the Start menu.
01:36I am not going to install Apache, MySQL, or FileZilla, which is in the FTP
01:42server, as services.
01:44Instead, I am going to want to run them as applications,
01:47so I will just leave those check boxes unselected and I will click Install.
01:52The extraction and copying of the files over to your hard disk will take a few minutes.
01:57You're getting copies of the Apache HTTP server, the MySQL database server, the
02:04FileZilla FTP server, phpMyAdmin--
02:08that's a web application for managing your MySQL databases--and many other
02:13components which you might be interested in.
02:15For example, WampServer also includes an entire PERL development environment,
02:20which is something you'd otherwise have to install separately on Windows.
02:28When you get to this screen, you're finished installing XAMPP.
02:32Click Finish and then to start up the XAMPP control panel, click Yes.
02:38If you see this dialog box, don't panic; everything is still okay.
02:42Click OK and that will open up the control panel application.
02:47You'll see that there are start buttons associated with each of the major
02:50applications we'll be using: Apache and MySQL.
02:54To start up Apache, click the Start button and then once it shows that it's
02:58running, click Admin.
03:01That should open up your browser and show this page that says "It works!"
03:06This is the very simple Apache homepage that's included with your
03:10XAMPP installation.
03:12Now, I will show you where that file is located.
03:15I will click the Explore button, and that opens up Windows Explorer to the XAMPP
03:20homepage and from there, I will double-click into the htdocs.
03:25This is the document root directory for your copy of Apache.
03:29This index.html file is the file that you saw on the screen.
03:33Now, I will go back to the XAMPP control panel, and I will start MySQL.
03:38You should see MySQL fire up very quickly.
03:41If you try to click the Admin button, in this version of XAMPP you will see
03:45that it doesn't do anything. That is, to put it bluntly, a bug.
03:49Here is the workaround.
03:52What you're trying to do is to get into the phpMyAdmin application, and you can
03:57get to it through the browser if you know the steps.
04:00Click the Admin button for Apache, instead of the button for MySQL,
04:03go to the URL, localhost, and append simply XAMPP to it.
04:11When you press Enter, that will change the URL and display a splash screen.
04:16And from there, click on English, or whatever language you want to read the page
04:21in, and that will take you to the homepage for the XAMPP installation.
04:26In some other videos in this chapter, I will show you some other tools that
04:29you can get to through this page, so you might want to bookmark, or set this
04:33page as a favorite.
04:35But here's the thing I wanted to show you.
04:38From this page, you can click on phpinfo.
04:41That will show you which version of PHP you're currently using. But most
04:45importantly, you can get to the phpMyAdmin web tool for managing your databases.
04:51Go down to Tools and click on phpMyAdmin.
04:55If this screen opens correctly, it means that both Apache and MySQL are
05:00operating correctly, and you're ready to start creating your own databases and
05:04managing your data through this web interface.
05:07XAMPP is installed by default with minimal security.
05:11It's designed to be used for local development only, and not as a production server.
05:17But there are certain security considerations you want to pay attention to, and
05:21I will show you how to deal with those security considerations in another video.
Collapse this transcript
Managing XAMPP for Windows
00:00Once you've installed XAMPP on Windows, you can manage it through the XAMPP
00:04Control Panel and through a variety of PHP based applications that you can
00:09access through the Control Panel.
00:11To get to the main homepage, click the Admin button next to Apache.
00:16That will take you to a page that has a number of links to various
00:18administrative apps.
00:21For example, the phpinfo link takes you to a simple PHP page nested within the
00:25homepage that reports your PHP configuration.
00:29Similarly, under the Tools section of the menu, you can click on phpMyAdmin.
00:34That takes you to the web-based interface where you can create databases and
00:38create tables and data.
00:40Click the Back button from there to return to the XAMPP homepage.
00:44You can also click on pearinfo.
00:45PEAR is a package of extensions included with PHP and once again this page
00:52simply reports your configuration.
00:55There are also some demo apps you can explore.
00:58For example the Phone Book is a PHP- based application that incorporates SQLite,
01:04a very lightweight SQL database that doesn't need a server.
01:07You can add data through the Phone Book.
01:10I'll add John Smith, and give him a fictional phone number, and then click Add,
01:18and you'll see that the data is correctly added.
01:21You can click Show the source code and you'll be able to explore the PHP page
01:25that's executing all of the functionality.
01:28So you can use all of these applications to learn a little bit more about PHP.
01:33Some of the other tools available here apply to applications that I
01:36haven't started yet.
01:37For example FileZilla FTP is an FTP server that's included with XAMPP for Windows.
01:45To start it up, go back to the XAMPP Control Panel.
01:48You will see FileZilla listed there along with the Mercury email server.
01:53Those applications are outside the scope of this course.
01:56That is, our focus is on Apache, MySQL, and PHP.
02:00But if you need those servers, you have them already as part of your
02:03XAMPP installation.
02:06Finally, I'll show you a very valuable tool that's included with the
02:09XAMPP Control Panel, the Port-Check tool.
02:11When you click Port-Check, the XAMPP Control Panel opens a command line window
02:17and reports all of the ports that are being used by various server applications.
02:21So for example, it shows that ports 80 and 81 and 443 are being used by Apache,
02:273306 by MySQL, and all the other ports that are listed here are reserved for
02:33these installed applications.
02:35But because the applications aren't currently running, they're reported as
02:38free at the moment.
02:40You can use this tool to diagnose port conflicts.
02:43That is, when you have more than one server application that are trying to
02:47listen on the same port. After exploring the list of ports, press Enter to
02:52continue and close that window.
02:55Finally, a few more things about the XAMPP Control Panel application.
02:59if you try to close the Control Panel application by clicking the X in the
03:03upper-right corner, it actually just minimizes the application.
03:06It doesn't really close it.
03:08To return to the application, go to your system tray and you'll find the system
03:13tray icon for XAMPP listed there.
03:16Click and it reopens the Control Panel application.
03:20When you're done with your servers, click the Stop button for both Apache and for MySQL.
03:26Make sure the buttons show the strings Start.
03:28That means all of your servers are shut down. Then click Exit and the XAMPP
03:33Control Panel will be completely shut down.
03:36To return to the XAMPP Control Panel, go to your Start menu, and if you're
03:40working in Windows 7 or Windows Vista, you can simply type XAMPP and you'll find
03:46the XAMPP Control Panel listed there, and you'll be ready to start over again.
03:50So that's a look at some of the administrative options available in XAMPP for Windows.
03:55The Windows version of the XAMPP software bundle is completely free and gives
03:59you a very easy way to get started with Apache, MySQL, and PHP.
Collapse this transcript
Managing MySQL security through XAMPP for Windows
00:00When you install XAMPP on Windows, your MySQL database server is installed
00:04without a root user password.
00:07On a production server this would be a disaster.
00:10But even on a local development system it's a good idea to set a database password.
00:16To accomplish this, go to the Admin page for Apache.
00:21This will open the XAMPP homepage.
00:24Then in the menu click on Security.
00:26It's the third item from the top.
00:29That opens a separate browser window.
00:32I'll maximize that window and show you that it displays a summary of
00:35your security settings.
00:38This is the setting that I'm concerned about.
00:40The MySQL admin user root has no password and then it has a note that every
00:45local user on a Windows machine can access the MySQL database with
00:49administrator rights.
00:51You should set a password.
00:53Here's how you set it.
00:54It's incredibly simple using XAMPP.
00:56Go to the bottom of the page and click the link localhost/security/xamppsecurity.php.
01:03That opens a little PHP page that lets you set the password.
01:06I'll click into the new password entry and type in my password.
01:11I'll use the simple string password and then I'll type it in again.
01:17You can also set random passwords for your PHP my admin user- I won't do that-
01:22and then you can click the button Password changing.
01:26You should get a message that the root password was successfully changed.
01:31Close all browser windows, then go to the MySQL item in your Control Panel
01:36application, stop MySQL, and then restart it.
01:43Then click the Admin button for MySQL.
01:48When phpMyAdmin opens, it should now open to a login screen.
01:52Type-in the username as root and type-in the password that you set and then click Go.
01:57I'll tell Internet Explorer not to remember the password.
02:02If you typed-in your username and password correctly, you should open
02:05phpMyAdmin successfully.
02:08You can now create new databases, manage existing databases' table structures,
02:13and add data to your databases all through the phpMyAdmin interface.
02:18As you start using content management systems such as WordPress or Drupal or
02:23working with PHP from other clients such as Dreamweaver, you'll need to use that
02:27password to connect to your MySQL database.
02:31This is just one of the useful tools that are included with the XAMPP software bundle:
02:35the ability to manage your MySQL database without having to work from
02:39the command line.
Collapse this transcript
Installing XAMPP for Mac OS X
00:00There are four versions of the XAMPP software bundle:
00:04for Linux, Windows, Mac OS X, and Solaris.
00:08They're all available from the web site www.apachefriends.org/en/xampp.html.
00:17To get started with XAMPP for Mac, go down to XAMPP for Mac OS X and click the
00:22link and then download the application.
00:24You will find that it's completely free and does not require registration.
00:29The application is delivered to you as a DMG file. Double-click the DMG file,
00:36and then to install XAMPP, simply drag the folder into the Applications folder.
00:40That will take just a few moments to copy the application over to your
00:44Applications folder.
00:46Once the copying process is complete, close the Finder window and eject the
00:51virtual disk named XAMPP for Mac.
00:55Before you start up XAMPP, check to make sure that you don't have any other
00:59copies of Apache or MySQL running.
01:01I will go to my System Preferences and from there to Sharing, and I'll make sure
01:07that my Web Sharing option is deselected.
01:10If you've installed MySQL separately, also make sure that it's stopped. Warning:
01:16if you've had MySQL or Apache running in that same session, you might want to
01:21shut them down and then reboot your Mac and only then start up XAMPP.
01:26Now I've currently got both servers stopped, so I am ready to roll.
01:29I will go to my Applications folder,
01:32I will go to Finder, and select Go > Applications.
01:36From there, I will scroll down to the bottom and locate the XAMPP folder, and
01:41here I will find an application called XAMPP Control.
01:44Just as with MAMP and other servers, the web document root where you put your
01:49HTML, PHP, and other web files is named htdocs, and you'll find that the folder
01:55already has some files that are seeded there for you.
01:59Now, I will go back to the XAMPP root folder, and I will start up the Control panel.
02:05If prompted, click Open.
02:07You'll see that XAMPP opens as two windows:
02:10there's a small control panel on the right and an informational screen at the left.
02:16I'll click the Start button for Apache, and if prompted, type my password.
02:22I'll click the Start button for MySQL as well.
02:25If you see green indicators on Apache and MySQL then you're ready to start
02:30using your XAMPP server.
02:32There's also an option for starting up an FTP server.
02:35I won't use that here.
02:37Now, to test my web site, I'll click localhost.
02:41That takes me to localhost/xampp/splash.php.
02:46I will click English and now I'm on the XAMPP homepage.
02:51From here, you'll be able to set status, control security, look at
02:55documentation, and execute a lot of other functionality.
02:59The phpinfo command which I've used in some other videos in this course is
03:03available from this screen already.
03:06When I click phpinfo, I'm shown the version of PHP that I'm running.
03:12Now to make sure that MySQL is running, I'll click on phpMyAdmin, which is
03:17right here under tools.
03:19If you're able to open phpMyAdmin, you're good to go.
03:23Your Apache server is running, your MySQL database server is running, and you're
03:27ready to create your own databases.
03:29Now again, there are many more options available in XAMPP, and I'll show you
03:33some of these in other videos.
Collapse this transcript
Managing XAMPP for Mac OS X
00:01The XAMPP installation includes a couple of useful management tools that will
00:05help you administer your servers.
00:08First, make sure that your servers are running through the Controls dialog and
00:12then go to your Getting Started window and click the localhost link.
00:16That will take you to the homepage.
00:19On the homepage take a look at phpinfo(). This is a simple page that outputs the
00:25configuration of your PHP server.
00:28The most important bit of information on this screen is the Loaded Configuration File.
00:33That's the location of the php.ini file that's managing your PHP installation.
00:38The default location is /Applications/XAMPP/xamppfiles/etc/php.ini.
00:48You can also open phpMyAdmin.
00:51Click phpMyAdmin under Tools.
00:54If you see the Prompt screen just click Go.
00:58Assuming you haven't set up a root user password on your MySQL installation, you
01:02should be able to go to phpMyAdmin instantly.
01:06You'll see over on the left that the installation of MySQL with XAMPP for Mac
01:11includes a number of databases, including the test database, a simple beginning
01:16database where you can add new tables and do some testing of some data.
01:21I'll go back to the main window and also show you that there are some
01:25sample applications that you might find useful.
01:27For example, the Phonebook application lists three names.
01:33This is an application that's built with PHP and SQLite, a very simple
01:37database much simpler and lighter than MySQL that's included with the XAMPP
01:42installation as well.
01:44I'll type in a value of Smith for the Last name, John for the First name, and
01:48then a fake phone number.
01:50Then I'll click Add and it'll show that the data has been added to the database.
01:57Click Show source code down toward the bottom and you will be able to scroll
02:00down and take a look at the PHP code that's executing this little application.
02:06There are some other useful sample applications you can explore as well.
02:10So that's a look at the sample applications and administrative tools that are
02:14included with XAMPP for Mac OS X. One other important application is used to
02:20manage the security of your XAMPP installation.
02:23I'll describe how to use this feature in the next video.
Collapse this transcript
Managing MySQL security through XAMPP
00:00When you install XAMPP for Mac OS X, a lot of the security options are left in an open state.
00:06That is your installation of both Apache and MySQL is insecure.
00:12There are some fundamental security things you should take care of after the installation.
00:16In the Getting Started window click localhost, then if prompted select your language.
00:23When you get to the homepage you can click the Security item under the XAMPP menu.
00:28On this screen you'll see a summary of your security settings.
00:31For example, your XAMPP pages by default are accessible over the network for everybody.
00:36MySQL is also accessible over the network, as opposed to only being available
00:42on your local system.
00:43There are also passwords for the phpMyAdmin user and for the MySQL root user.
00:49To change these settings you'll need to run an application called XAMPP Security.
00:55You can run this application from Terminal.
00:57Here is a quick and easy way to start it up.
01:01Go to the bottom of the page and select the command to open the application and
01:06then copy that command to the clipboard.
01:09Now open Terminal and then on the command line I'll start by typing sudo, for super user do.
01:18Then I'll type in a space character and then I'll press Command+V to Paste in the command.
01:23I'll press Return and that starts up the security application.
01:28Depending on your most previous actions and your computer's configuration,
01:33you might be prompted at this point for your administrator password.
01:36That's your Mac user password.
01:39Type it in and press Return if necessary and then paste in the command again.
01:45First I'm asked whether I want to secure my XAMPP pages.
01:48If I type Y for Yes, that means that I'll be securing the pages when they
01:53requested through the browser.
01:55For local development that's a bit of a pain, so I'll type in N and press return.
02:01Next, I'm asked whether MySQL should be accessible via the network.
02:05Once again, I'll type in N. Next, I'm asked for a phpMyAdmin root user password.
02:12I don't want to set that password because it's going to slow down my development work,
02:15so I'll type in N. But here's a password I do want to set.
02:21The MySQL root password typically should be set, because even for local
02:25development it's a good idea to test a user with a secured account.
02:30So I'll type in Y for yes and press Return, then I'll type in a password that I want to use.
02:35I'll use this simple string password.
02:37I'll type it in once and press Return, then type it again and press Return.
02:44Finally, I'm asked about my FTP server, which I'm not using.
02:48So I'll just press Return and that completes the security application.
02:53To test the security settings I'll click back on the browser and then refresh the page.
03:01I'll click Security again and I'll see my new settings.
03:05I'll go to phpMyAdmin and I'll see that I'm prompted for a username.
03:10I'll type in root and password.
03:14I've successfully opened phpMyAdmin and I can now manage my MySQL Server.
03:20So that's how you can reset your security settings through the
03:22Security application.
03:25On Mac, once again, it's a command line application that you use through Terminal
03:29and you can control whether your MySQL and Apache servers can be accessed over
03:34the network and you can reset your administrator passwords.
Collapse this transcript
6. Installing BitNami
Installing BitNami for Windows
00:00BitNami is an organization that creates open source distributions of the AMP stack.
00:06It creates both simple AMP stack distributions including just Apache, MySQL and
00:11PHP, but really specialized in creating distributions that include common
00:16content management systems or other web applications.
00:20I've gone to the web page bitnami.org/stacks.
00:25Under the BitNami Application Stacks caption, you'll icons for many popular web
00:31applications, including content management systems like WordPress, Drupal and
00:35Joomla!, contact management systems like SugarCRM and many other applications.
00:42Each of these icons will take you to a distribution of the AMP stack that
00:47includes the particular application already installed.
00:50But if all you want is a simple AMP stack, BitNami has that too.
00:55Scroll down toward the bottom of the page to the section captioned BitNami
01:00Infrastructure Stacks.
01:02At the top, you'll see icons for WAMPStack for Windows, LAMPStack for Linux and
01:08MAMPStack for Mac and a number of other stacks.
01:12I'll be using WAMPStack in this video.
01:15I'll click the link and you'll see that there's an installer for the most recent
01:19stable version 5.3.13.
01:23If you want an installer that includes 5.4, you can scroll further down and
01:28you'll find a Development stack available here.
01:31Notice that this is for development purposes only and is not to be used in
01:35production environments.
01:37So I'll be using this version WAMPStack 5.3.13, which I've already downloaded to my Desktop.
01:44I'll double-click to start up the application and if prompted with the User
01:49Account Control dialog, I'll click Yes.
01:52I'll step through the options and on this screen I'm allowed to select the
01:57components I want to install.
01:59In addition to phpMyAdmin which you will definitely want to install, you can
02:03also select one or more of the common MVC frameworks that are supported in PHP,
02:10Zend Framework, Symfony, CodeIgniter and CakePHP.
02:15Each of these options will take additional time to install.
02:19I'm not going to be using most of them.
02:21I'm going to deselect Symfony, CodeIgniter and CakePHP and I'll keep Zend
02:25Framework and then I'll click Next.
02:29I'll accept the default installation location, make a note of that and click
02:33Next again and here I'm asked for the password that will be applied for the
02:38MySQL database root user.
02:42The installer requires a password of at least six characters.
02:46I'll type a simple password in, make sure you remember whatever you type here
02:51and I'll click Next.
02:53On this screen, you are asked if you want to view a little bit of advertising
02:57about BitNami's Cloud Hosting offerings.
03:00I'll deselect that option and click Next.
03:03I'll click Next again to launch the installation.
03:07Depending on how many of those MVC frameworks you installed, the installer will
03:11take a certain amount of time to copy the files over to your hard disk.
03:16All other things being equal, the BitNami WAMPStack will take quite a bit longer
03:20to install than say, WampServer, because it's including more software especially
03:26if you selected one or more of the frameworks.
03:30When you get to this screen, your WAMPStack installation is complete, leave the
03:34option checked to Launch the WAMPStack and click Finish.
03:39That should result in opening your browser and taking you to the Home page.
03:44Notice that the WAMPStack is running on 127.0.0.1 and can also be reached at localhost.
03:53There're two tabs in the homepage, a Welcome screen and an Applications screen
03:58which you will see is empty.
04:00Here's how you can stop and restart WAMPStack.
04:03There are two ways;
04:04one is through the Control Panel.
04:07WAMPStack installs both Apache and MySQL as services.
04:12So you can control them through the Windows Services console.
04:16In the Control Panel, type in services into the Search Box and click View
04:21local services, scroll down toward the bottom and look for the services that
04:27start with WAMPStack.
04:29You'll see both wampstackApache and wampstackMySQL and you can stop and start
04:34these services from this screen just as with any other services.
04:39But there's also a special graphical user interface that's installed with the WAMPStack.
04:44To find that, go to the folder where the WAMPStack is installed.
04:49I'll go to Windows Explorer.
04:51I'll go to the C drive to Program Files, to the folder BitNami WAMPStack. Look
04:58for the application manager- windows and double-click to open it.
05:04If you see a User Account Control dialog, click Yes.
05:08This screen has two tabs labeled Manage Servers and Application log.
05:14I'll click Manage Servers and go to Apache Web Server and stop it, and then I'll
05:19do the same thing for the MySQL Database.
05:22Over in the Application log, I'll see messages indicating the stopping of the two services.
05:28I'll come back to Manage Servers tab and click Restart All, and now both my
05:33Apache Web Server and MySQL Database are running.
05:37Finally I'll test the Database.
05:40I'll go back to the browser and I'll change the URL to localhost/phpmyadmin and
05:47that takes me to the phpMyAdmin web application.
05:51I'll set the username to root, that's the default name of the root user, and then
05:56the password to the password I set during the installation.
06:00I'll click Go and that opens up phpMyAdmin and shows the default tables,
06:07information_schema, mysql, and so on.
06:10If you have this much working, then you're BitNami installation is complete
06:14and operational and you can get started developing and testing your PHP-based
06:19web applications.
Collapse this transcript
Installing BitNami for Mac OS X
00:00As I've previously described, BitNami creates and distributes free installer
00:05packages that include Apache, MySQL and PHP, but optionally can also bundle
00:11common PHP-based open source applications, such as popular content management
00:17systems like WordPress, Joomla! and Drupal.
00:20You can find all of these distributions at bitnami.org/stacks.
00:25Under BitNami Application Stacks you will find the distributions that include
00:30these applications, but if you're just looking for a simple AMP installer,
00:35scroll down toward the bottom of the page to BitNami Infrastructure Stacks.
00:40I'll be using this one, MAMPStack, the AMP Stack for Mac OS X. As of the date of
00:46this recording, the most recent stable installer was MAMPStack 5.3.13.
00:52If you're looking for PHP 5.4, it's not part of this installer, but there is a
00:58Beta distribution available.
01:00Scroll down toward the bottom of the page and look for the Development section.
01:05As the message reads, this distribution 5.4.0 is intended for development
01:11purposes only and shouldn't be used in production environments.
01:15But if you are trying to get started with PHP 5.4, this is an easy way to do it.
01:19I'll scroll back up toward the top and this is the installer that I'll be using.
01:25I've already downloaded it to my Desktop.
01:28Now my goal is to install Apache, so that it's listening on port 80.
01:33Before I start the installer, I'm going to make sure that the included copy of
01:38Apache, that comes with Mac OS X, isn't activated.
01:41I will go to my System Preferences and I'll click on Sharing and I'll check
01:46that Web Sharing is off.
01:49Once I have verified that, I'm ready to start the installer.
01:52There are two ways of starting the BitNami installer.
01:56You can double-click on the icon to start the installer.
02:00You'll be able to install MAMPStack this way, but you might be forced to install
02:04Apache with a port other than port 80.
02:07So instead of starting the installer application this way, I instead recommend
02:12starting it from Terminal where you can start it up as the super user.
02:16I will cancel this and I'll open up Terminal.
02:19I will go to the Spotlight and type in terminal and then press Return.
02:25I'm going to switch to the folder that contains my installer.
02:28I will type cd ./Desktop.
02:32Now I'm in the Desktop folder.
02:35I'm going to be starting up as the super user.
02:37So I will type sudo, which stands for super user do and then a space.
02:43Now I'm going to run a script that's a part of the installer package.
02:47I will type ./bit for BitNami and I will press Tab, Terminal completes the
02:54application package name.
02:56Now I'll drill down a little bit further, I will type in Con with an uppercase C
03:01and press Tab, that takes me to the Contents folder, and then Mac with an
03:06uppercase M and Tab again and that takes me to the MacOS folder.
03:11Now I'll type inst for install.
03:15I will press Tab and Terminal completes the beginning of the file name
03:19installbuilder, then I'll type .sh and that's the actual complete name of
03:25the startup script.
03:27When I press Return, I'll be prompted for my administrator password, which I'll type in.
03:33When I press Return, I'll now be running the MAMPStack installer as the super
03:37user and that will ensure that I have rights to install Apache using port 80. I will click Next.
03:45On the Select Component screen, deselect any components you won't be using.
03:50For example, I sometimes use Zend Framework, but I typically don't use Symfony,
03:55CodeIgniter or CakePHP, which are popular MVC frameworks for PHP.
04:01If you don't need the components, you can save time and disk space by
04:05not installing them.
04:07You will want to make sure you include PhpMyAdmin.
04:10Click Next and then select the folder where you want to install the MAMPStack.
04:16The default folder name will include the version number as shown here.
04:19I will accept the default and click Next.
04:22On this screen I'm asked for MySQL root account password.
04:27The BitNami installer requires a password of at least six characters.
04:31I will type in a password.
04:35I will make sure I type it the same way twice and I will also make sure I'm
04:39typing in the password I can remember easily later on. I will click Next.
04:43And on this screen, I'm asked whether I want to see information about BitNami's
04:47Cloud Hosting services.
04:48I will deselect the option and click Next again and I'll click Next and now the
04:54installation begins.
04:56The BitNami installer will take a few minutes to copy all of its files over to your hard disk.
05:02When you come to this screen, the installation is complete, leave the option
05:06checked to Launch the MAMPStack and click Finish.
05:10When the installation is complete, a browser should open and you should be taken
05:15to 127.0.0.1, the IP address for the local system.
05:21You can also reach the BitNami homepage from http://localhost.
05:28Now I'm going to close all of my browsers and I'm also going to close Terminal
05:33to finish up the installation process.
05:36I'll open up a browser again and then to get to phpMyAdmin, I'll type in
05:41http://localhost/phpmyadmin.
05:48That takes me to the phpMyAdmin login screen.
05:52I'll type in the username which will be root and the password which is the
05:56password I entered during the installation process.
05:59Then I will press Return or click Go, and I'll be taken to the phpMyAdmin screen.
06:06If this screen appears correctly, then BitNami is fully installed and working
06:11with Apache, MySQL and PHP.
06:15In order to stop and start the BitNami services, go to Finder, go to the folder
06:20where you installed BitNami, I'll go to Applications > MAMPStack.
06:26From there, look for an application named manager-osx, double-click to open it.
06:33If prompted for your administrator password, type it in.
06:37The MAMPStack manager is a simple graphical user interface.
06:41I will click on it to bring it into the foreground and show you that there are
06:45items for starting and stopping MySQL and Apache.
06:49There are two tabs: Manage Servers and Application log.
06:53I will all start on the Managed Servers tab and I'll stop both servers
06:58by clicking Stop All.
06:59I will look at the Application log and watch the log messages go by.
07:05I'll come back to the Manage Servers tab and once I see the indication that the
07:09servers have stopped, I will click Start All.
07:13And once again I'll go back to the Application log and watch the messages.
07:18Once I see the running message for both MySQL and Apache, I'll know that my
07:23services have started again.
07:25But the real task is to make sure that you can get to phpMyAdmin.
07:29So once again, I'll go to a browser, and I will type in localhost/phpmyadmin and I'll log in.
07:37And there is phpMyAdmin running correctly.
07:41So that's how you can install BitNami on Mac OS X and manage it stopping and
07:47starting it from the graphical user interface.
Collapse this transcript
7. Troubleshooting
Handling port conflicts with Skype on Windows
00:00If you use Skype to make phone calls on Windows, you might find that there is a
00:04port conflict between Apache and the Skype client.
00:09I'll show you what it looks like and then how to resolve it.
00:12I have the Skype client open on my desktop, and now I'm going to go to the
00:16Windows Services Console, which is available through the control panel.
00:21I'll go to the Apache2.2 service, which currently isn't running, and I'll try
00:26to start this service.
00:28I see this error message. It's a very mysterious message, but essentially it's
00:32telling me that Windows couldn't start the service.
00:34The reason is because Apache is trying to use port 80 and the Skype client has
00:40already reserved that port.
00:42Now one way of solving this is to close Skype, then start up Apache, and then
00:46start Skype up again.
00:48Apache will have reserved the port for that session and then Skype won't be able to use it.
00:54But a better way is to reconfigure Skype not to use that port at all, so I'll
00:58show you how to do that.
01:01In the Skype client, I'll go to Tools > Options. In the Options dialog, I'll click
01:07Advanced > Connection, and I'll deselect this option, Use port 80 and 443 as
01:14alternatives for incoming connections.
01:18When that option is deselected, the Skype client will no longer try to reserve
01:22the ports for its use and Apache will be able to get started.
01:25I'll click Save, and I'll see this message indicating that the changes will only
01:30be applied the next time I start Skype.
01:33I'll click OK, I'll close this Skype window, then I'll go down to the taskbar,
01:40right-click, and choose Quit Skype.
01:43That makes sure that the Skype client is completely shut down, and if I see this
01:47confirmation dialog, I'll click Quit.
01:50To make absolutely sure that Skype is out of the system, I'll go to my system
01:54tray and I'll check for any Skype indicators that might still be here.
01:59I don't see any there and so I'm good to go.
02:02Now I'll restart Skype. So now Skype is running, and I can make phone calls, but
02:09because I didn't reserve port 80, I should also be able to start Apache.
02:13I'll go back to the Services panel, which I have in the background.
02:17I'll choose the Apache Server and click the Start button, and now Apache starts
02:22up quickly and cleanly.
02:24So you can have both Apache and Skype running on the same system, but only one
02:28of them can be using port 80 at the same time.
02:31My recommendation is to turn port 80 off in Skype and let Apache use it.
Collapse this transcript
Handling other port conflicts on Windows
00:00You can only have one copy of MySQL and one copy of the Apache HTTP
00:05Server running at a time.
00:07If you try to install and run more than one, you'll get a port conflict.
00:12MySQL listens on Port 3306 and Apache on Port 80, and only one process can
00:17listen on each port at a time.
00:20I'll show you how to recognize and then how to resolve port conflicts
00:23on Microsoft Windows.
00:25I currently have the Local Services control panel opened, and it shows that
00:29Apache 2.2 is started and then I'll go down to MySQL and show that has started as well.
00:36I've also installed XAMPP and WampServer.
00:40I'll start at the XAMPP Control Panel. This Control Panel shows that both Apache
00:45and MySQL are running, but notice that the Service checkboxes are selected.
00:51These reflect the native services that were installed, not the versions that
00:55were installed with XAMPP.
00:57Now I'll click the Admin button for Apache and instead of going to the XAMPP
01:02homepage as expected, I get a Not Found 404 error, indicating that the XAMPP URL wasn't found.
01:09That's because I'm trying to navigate to the homepage on XAMPP, but instead I'm
01:14sending a request to the Apache HTTP native server.
01:18I'll prove that by going to http://localhost without the XAMPP directory and
01:23I'll get the native homepage saying, "it works!"
01:27Now, here is how you can recognize the same circumstance when trying to use WampServer.
01:31I'll double-click the WampServer icon to start up the server and then in
01:35the system tray the gauge shows red and then perhaps some other color, but
01:40it doesn't go all the way to white as it would to indicate that the servers ran successfully.
01:46I'll click the icon and try to click Start All Services, and once again the
01:50gauge just doesn't change color.
01:53Now I'll go to the WampServer homepage and click Localhost and once again
01:58instead of getting the WampServer homepage I get the native Apache homepage.
02:03Now you can resolve this fairly easily by going into the Services control panel
02:08and stopping the services, and then you should be able to run the other
02:11versions of the services.
02:14So in the control panel I'll select Apache 2.2 and click the Stop button.
02:20Then I'll go down to MySQL and once again I'll click Stop. Then I'll go to the
02:26WampServer icon in the system tray and choose Start All Services and now the
02:32gauge goes to all white.
02:35To show that both services that are a part of WampServer are running
02:38successfully, I'll open up phpMyAdmin.
02:42If you can get to phpMyAdmin you know that both MySQL and Apache are
02:46running successfully.
02:48Now here's another way that you can find out what's running on your system.
02:52I'm going to stop the WampServer services and then go back to the control panel
02:58and restart both MySQL and Apache.
03:02It doesn't matter what order I start them in.
03:07Then I'll show you a trick you can do on the command line to find out whether
03:10certain ports are in use.
03:12I'll click the Windows Start button and type in cmd and open the
03:17Command application.
03:20In the Command application I'll use an application called netstat.
03:24This is an application that's included with Microsoft Windows.
03:28It should be available on all versions of Windows including XP, Windows
03:32Vista, and Windows 7.
03:35I'll use the netstat application with a parameter of -a, which means show me all
03:40server applications listening on the TCP/IP Stack.
03:45And then after netstat -a, I'll type in a pipe character and then the Find application.
03:51This allows me to take the output of the netstat application and filter it
03:56looking for a particular string.
03:58I'll type in the string LISTENING, in all uppercase and wrapped in quotes.
04:04Here is the result.
04:05It lists all of the ports that are currently in use on your computer.
04:10Notice port 80 is on the first line and port 3306 appears below.
04:15The exact order of the ports displayed will depend on the configuration of your computer.
04:20Now to demonstrate what happens when you shut the applications down, I'll go
04:24back to the Services panel and I'll stop Apache and MySQL.
04:28I'll come back to the Command line window.
04:38I'll press the Up Arrow to repeat the last command and press Enter, then
04:43scroll up a bit and show that both port 80 and port 3306 have disappeared from the list.
04:49The netstat application lets you verify that those ports have been released by
04:53whatever application was using them.
04:56So that's a look at how you can recognize and then resolve port conflicts.
05:01Port conflicts occur when you install more than one copy of a server application
05:06and try to run them all at the same time.
05:09You can easily find out what's happening and then fix the situation by knowing
05:13how to recognize the symptoms in both the server bundled applications and in
05:18the command line.
Collapse this transcript
Detecting and handling port conflicts on Mac OS X
00:00When you install more than one copy of a particular server application, such as
00:04Apache or MySQL, and then try to run both at the same time, you will run into a port conflict.
00:11Apache, for example, listens on port 80 and only one application at a time can
00:16listen on that port.
00:18To demonstrate this, I have installed both the individual components, Apache and
00:24MySQL, and XAMPP represented by the XAMPP Controls panel, and MAMP represented by
00:29the MAMP application.
00:31Now, I'll go into the System Preferences and show you that both MySQL and
00:35Apache are running.
00:36I'll go into MySQL and show that the MySQL Server instance is running and then
00:42I'll go to Sharing and show you that Web Sharing is selected.
00:47Now, I'll show you what happens in XAMPP and MAMP when you try to run the same applications.
00:52XAMPP gives you a lot of help.
00:55I'll click the Start button for Apache and I get a really clear message. Web Sharing is on!
01:00And it tells me exactly how to fix the problem.
01:04I can do the same thing for MySQL and once again I get a great error message.
01:09If you're working with MAMP though, this symptom is less clear.
01:13I'll click Start Servers in the MAMP application and simply nothing happens.
01:19Both the Apache Server red light and the MySQL Server red light stay lit.
01:23They don't switch to green.
01:25That's an indicator that the applications weren't able to start.
01:29Now the simplest thing to do is to go back to System Preferences and turn
01:33off the applications.
01:35So I'll go to Sharing and deselect Web Sharing and then go back to the main
01:40System Preferences pane and go into MySQL and click Stop MySQL Server.
01:47If I'm prompted at any point for my Administrator password I'll type it in.
01:52Once the applications are stopped, I should be able to start Apache and MySQL
01:57for my selected server bundle.
02:00So I'll go to XAMPP and click Start on Apache. Once again I'm prompted for the
02:04Password, and I'll click Start for MySQL, and this time both start successfully.
02:10Now I can't have XAMPP's versions of these servers and MAMP's running at the same time.
02:16So if I click Start Servers here I'll run into the same problem.
02:20Now I'm going to turn off the XAMPP versions and restart the
02:25individual components.
02:27I'll restart MySQL Server and restart Apache and I'll show you a way of
02:33finding out which versions of these servers are actually running, using some
02:37commands in Terminal.
02:40I'll go to Terminal by going to Spotlight, typing terminal, and choosing the
02:45application Terminal.
02:49Within the application I am going to use a command called lsof, which stands
02:53for List Open Files.
02:55I'll run this command as the superuser.
02:57So I'll start with superuser do, or sudo, then a space, then lsof and then I'll
03:04add a couple of parameters, -i and -P.
03:10Then I'm going to filter the result of this command and look for applications
03:15that are running on a particular port.
03:17MySQL runs on Port 3306.
03:21To do the filtering I'll type in the pipe character then grep, which searches text,
03:26and then the string I'm looking for, 3306.
03:31If I'm prompted for my Administrator password I'll type it in.
03:36This process might take a few seconds the first time you run it so be patient.
03:41So this shows me that MySQL is in fact running.
03:44It tells me that the name of the process is mysqld and it assigns a Process ID,
03:50which is random, of 29585.
03:54Now, to stop the process I could go back to my System Preferences pane. I'll go
04:00to MySQL and I could click Stop MySQL Server.
04:05But another way of doing this is to kill the process from the command line,
04:09using the UNIX command Kill.
04:12You do this by the Process ID. So I'll double-click the Process ID and copy
04:17it to the clipboard.
04:18And then I'll type sudo, for superuser do, then kill and then I'll paste in the Process ID.
04:27I'll go back to the System Preferences pane and show that the MySQL Server
04:31instance has stopped.
04:34You can do the same thing for the Apache server.
04:37So I'll type in sudo lsof -i -P, then the pipe character, grep, and then
04:47I'll search for port 80.
04:49Now make sure that you don't have any web browsers currently running.
04:53If you have browsers running you'll to get back a whole bunch of more
04:56information than you expect.
04:57So I'll just go down to my Dock and make sure I don't have Firefox or Google
05:01Chrome or Safari running, then I'll come back to Terminal and press Return.
05:06Once again, it might take a few seconds for the process and the search to complete.
05:12Here is the response.
05:13Notice I'm getting back more information than I am expecting.
05:16What I'm really looking for is this string, :80, and I see that there are two
05:21processes running with httpd, the actual name of the Apache HTPP Server process.
05:28If I wanted to kill these processes from the command line I could once again
05:32select and copy the Process IDs and kill them, but this time I'll stop the
05:37process from the System Preferences pane.
05:40I'll go back to the Sharing pane.
05:42I'll deselect Web Sharing.
05:45I'll come back to Terminal and press the up arrow key to restore the last command.
05:50I'll press Return and once again it'll take a few seconds to run the process.
05:57And when the response comes back, the httpd processes are not there anymore.
06:02So that's a look in various ways of how to diagnose and then solve port
06:07conflict situations.
06:09Again, you can only have one copy of Apache and one copy of MySQL running at a time,
06:14and if you're not sure where the ports are being used you can use both the
06:19applications that come with these products and some commands in the Terminal
06:23application to diagnose and solve your issues.
Collapse this transcript
Configuring Apache to work with IPv6 on Windows 8
00:00If you are a particularly adventurous developer, you might try installing an AMP
00:04stack on Windows 8 and you might run into some issues.
00:08Windows 8 has switched to the IPv6 system of assigning IP addresses and that
00:15changes how the localhost or the local machine's requests are interpreted.
00:21I'm going to show you how the issue appears and then how to fix it.
00:26I've installed the latest version of the WampServer on Windows 8 Consumer Preview.
00:31I'll go to the system tray icon and I'll open the Administrative menu for
00:35WampServer and I'll select Localhost.
00:39The browser opens, but shows an error.
00:42The web site declined to show this web page.
00:45And I'll click More information link to show the detailed error.
00:49It's an HTTP 403 Forbidden error, which means that the server has not recognized
00:55the browser as having permission to view the web page.
00:58The issue here is that WampServer is configured by default to only accept
01:03requests from the local system and for some reason, it thinks this browser is on another system.
01:11There's a very simple way of fixing this small error, the inability to get to
01:15localhost or the homepage.
01:17I'll go back to that Administrative menu and I'll choose the bottom menu choice; Put Online.
01:24The WampServer being online means that it can now receive and respond to
01:29requests from other computers.
01:31I'll close the browser, then I'll come back to my Administrative menu and
01:35choose Localhost again, and now I can get to the WampServer homepage and you
01:40might think it's all solved, but then I'll try to get to phpMyAdmin and I'll
01:45get that same error again.
01:48It turns out that putting WampServer online fixes part of the problem, but not
01:52the whole thing, and it's also good to understand the underlying issue which is how
01:58Apache is configured in a default WampServer installation.
02:02I'll close the browser and I'll switch WampServer back to being offline.
02:07Now let's take a look at the Apache configuration files.
02:12I'll go to Windows Explorer and I'll open up the wamp installation folder,
02:15C:\wamp and from there, I'll go to the bin folder to apache to Apache2.2.21,
02:25the version I'm working with, and from there to the conf folder which stands for configuration.
02:31I'll open the file httpd.conf.
02:35You can open this file in any text editor.
02:38I'm going to search for the string 127.0.0.1 and I get down to this section.
02:45This is the section that manages security for the wamp/www/ directory, the
02:51document root folder.
02:53Notice that there are three lines here:
02:55Order Deny, Allow, Deny from all and Allow from 127.0.0.1.
03:03This configuration file is designed for a local computer that's running on IPv4,
03:10the system for assigning IP addresses that was used in previous versions of
03:14Windows and that's also installed in current versions of Mac OS X. It turns out
03:20that IPv6 assigns a different IP address.
03:24Here's how you can discover the correct IP address.
03:27I'll open up the Command Prompt.
03:30I'll move the cursor down to the lower left-hot corner and right-click and
03:34choose Command Prompt.
03:36I'll type ping localhost and it shows me that the IP address of localhost under
03:44IPv6 is something called ::1.
03:50::1 in IPv6 is the equivalent of 127.0.0.1 in IPv4.
03:59So here's how I'll allow my local computer to get to the homepage of WampServer.
04:05I'll go back to the configuration file, I'll make a copy of this line and then
04:10paste it right underneath and in the second line, I'll change 127.0.0.1 to ::1,
04:19I'll save my changes by pressing Ctrl+S, I'll go back to my Administrative menu
04:24for WampServer and I'll restart all services.
04:28I'll wait until the icon changes colors a couple of times then I'll go back and
04:33choose Localhost and now I'm able to get to the homepage again and to any other
04:39files that are within my document root folder.
04:42But I'm still going to have trouble getting into phpMyAdmin and that's because
04:46the phpMyAdmin files are not placed within the www folder.
04:52The security rule, I just applied, applies to my main document root, but not to
04:57files that are outside that folder.
05:00These files are managed through something called an alias.
05:02So I'm going to close that browser and close Notepad for a moment, and I'll close
05:08everything except for Windows Explorer.
05:11I'll go back to the wamp home folder C:\wamp and I'll go to the alias folder.
05:17The alias folder contains small configuration files that are included for each
05:23of the web applications that's installed with WampServer;
05:25phpmyadmin, sqlbuddy and webgrind.
05:31I'll open phpmyadmin.conf and I'll maximize, it and I'll see that the same issue is here.
05:38There's an Allow from for 127.0.0.1, but I'm not being allowed to make requests
05:44from the IPv6 version of localhost.
05:48So I'll copy and paste that line and once again I'll change to ::1.
05:55I'll save the change, I'll restart my services.
05:59I'll once again wait until that icon changes colors a couple of times. I'll
06:03go back to Localhost and I'll go to phpmyadmin and now I have access to that application.
06:11I can repeat the process for the other two web applications, and if you create
06:15your own new aliases, you'll need to go in and modify those configuration files as well.
06:21The important part of this, in Windows 8, is that Windows 8 now uses IPv6 to
06:27assign IP addresses and that changes what localhost means.
06:32We've been accustomed for many years to knowing that localhost means the IP
06:37address 127.0.0.1 and an IPv6 that IP address has changed to ::1.
06:46WampServer is affected by this especially because its default configuration
06:51files have this rule built-in.
06:54But when you know the rules and you know how to change the rules, you'll know
06:58how to get AMP server stacks installed and working correctly on Windows 8.
Collapse this transcript
Conclusion
Goodbye
00:00Hi, David Gassner here again.
00:02Thanks for joining me on this tour of the various options for installing a local
00:06AMP stack with Apache, MySQL and PHP.
00:10You should now have a reliable local installation that you can use for your
00:14development and testing.
00:16Whether you watched the whole course or just used a single chapter, I hope that
00:20this content made it easier to get started with these free software products.
00:24If you came here from another lynda.com course, I hope this video series made it
00:28easier to get started.
00:29Happy learning!
Collapse this transcript


Suggested courses to watch next:

MySQL Essential Training (2h 46m)
Bill Weinman



Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,141 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked