Join David Gassner for an in-depth discussion in this video Installing phpMyAdmin with separate AMP components, part of Installing Apache, MySQL, and PHP.
- phpMyAdmin is the popular web based interface for managing your MySQL installation. It's open source and completely free, and you can download it from this website at phpmyadmin.net. If you're using one of the popular bundles for Apache, MySQL, and PHP, you probably already have this installed. But if you're using the individual components and want to use this, you have to install it yourself. First, choose the version you want.
I'm going to be demonstrating the latest stable release, version 4.2. But as of this moment there's also a beta available for 4.3. I've already downloaded the installation package to my desktop. phpMyAdmin is cross platform. It's written in pure PHP, so you use the same version regardless of which operating system you're working on. To install phpMyAdmin you'll need to note your Apache server's document root folder.
On my computer, I installed Apache under C:\Apache and the default document root folder is htdocs. So this is where I'll be installing. I'll double click my zip file, and I'll find that there's a top level folder. Underneath that folder are all of the files that make up phpMyAdmin. I'll go back to the top level, and then I'll drag this folder and drop it into my document root.
If you're working on Mac or Linux you'll probably need to extract the file first and then drag and drop the folder over. Either way, all you have to do is get those files into your document root folder and you'll be ready for the next step. Once the files are placed, rename the folder to make it easy to access through the browser. I'm going to rename it simply phpmyadmin, all lower case. Next, make sure that your Apache server has started.
I'm now running Apache as a Windows service, so I'll go to the control panel, I'll go to the services console, and I'll look for Apache2.4, and I'll confirm that it's running. Then, I'll go to a browser, and I'll type http://localhost/phpmyadmin. Now, on some installations, that's enough. phpMyAdmin just launches.
But, on most copies of Apache, this won't start it up right away. Because Apache doesn't know that the file index.php is the default file to start up the application. So if that doesn't work on your system just scroll down a little ways and find index.php and click it. Now on Mac and Linux, that should be enough. phpMyAdmin will launch and you'll see the log in screen.
And if that works, you're ready to go on to the next step after this video. But on Windows, you probably have a little bit more work to do. You'll probably see this error indicating that there's an undefined function called mb_detect_encoding. To fix this, you need to make some changes to your PHP initialization file. Here are the steps. First of all, go to your PHP installation folder. On my system, that's C:/php.
And then locate your php.ini file. It'll be marked on Windows by default with this little icon, and you should see under the type 'Configuration Settings'. Open it in any text editor. I'm using TextPad. Now search for a setting called extension_dir. It's at about line 737 of the default php.ini file for developers.
Notice that there are two suggested settings. I'm going to set this one for Windows, and I'm going to set it to that same directory that I just showed you, under C:/php/ext. Then, very importantly, I'm going to remove the semi-colon at the beginning of the line. The semi-colon is a comment character. It means, to PHP, ignore this line of code.
By removing it we're activating this setting. Now, let's take a look at what's in that directory. I'll go to C:/php/ext and I'll find a whole bunch of dll files on Windows. Now again, if you're working on Mac and Linux this works differently and you don't need to be going through these steps. But on Windows, the extensions are delivered as dlls and you have to activate or deactivate as you need for the features you want to use.
So now let's take a look at how to activate certain extensions that we need. I'll go back to the ini file and I'll search for a string gd2. Here's the first extension, php_gd2.dll, and I'll remove the semi-colon at the beginning of that line. That activates that extension. Now I'll go down a few more lines and I'll find one named mbstring.dll and I'll activate that.
And I have two more. I'll activate the next line for exif, and then two lines further down I'll activate mysqli. That's the MySQL driver that phpMyAdmin depends on, and that you'll probably need for your own development work as well. I'll save my changes. Now, to activate all those changes I'll go back to my Services panel and I'll restart Apache.
I'll just click the restart button. If you're working with Apache from the command line go to your command line interface and press ctrl + c to stop Apache and then run httpd again to restart it. Now I'll go to the browser and I'll refresh. And there's phpMyAdmin. On my system, I've already remembered my username and password. I'll just type my password again to be sure, and then I'll click Go, and there's my activated phpMyAdmin installation.
If you're working on Mac or Linux, you can try the same thing now. You will need to know your MySQL server root password, and if you don't know it, you can reset it. Take a look at the instructions later in this course for how to reset your MySQL Admin password, and then you should be able to open phpMyAdmin. One final note. In the left panel, you see a listing of the already installed databases.
The names and number of these databases will differ depending on which operating system you're on. On Windows, these are the default databases, but you might not see as many on other operating systems.
- Installing Apache, PHP, and MySQL separately
- Activating Apache and PHP on Mac OS X
- Installing and configuring phpMyAdmin
- Installing WampServer
- Installing MAMP
- Configuring MAMP's Apache and MySQL server ports
- Installing XAMPP for Windows and Mac OS X
- Managing MySQL security through XAMPP
- Installing Bitnami for Windows and Mac
- Detecting and handling port conflicts
- Working with Apache and IPv6 in Windows 8