Install and configure phpMyAdmin on IIS

Categories:

Now that you have installed and configured PHP 5 for IIS along with your MYSQL 5 Server, it's time to start doing something useful with it. And where better to start the the enormously useful phpMyAdmin tool written in PHP to manage just about all things MySQL via a web interface. phpMyAdmin is the veritable swiss army knife for all your MySQL administration needs, all conveniently package in a easy to use web interface. Don't just take my word for it, phpMyAdmin just won best Best Tool or Utility for SysAdmins in this years Sourceforge Community Choice Awards. You get the idea then, it is pretty good. In this guide we'll show you how to install and configure phpMyAdmin 3.x in your IIS environment. This guide assumes that you have already installed and configured PHP and MySQL which are required for phpMyAdmin to work. If not, then these guides can be found in the "How To Guides" section of this site.

Installation

First thing to do after you download and extract phpMyAdmin is place the extracted files in the appropriate directory inside your IIS web root so that IIS is able to access it. You may wish to create a separate website for your phpMyAdmin installation, or simply add it as a sub directory or virtual directory under an existing website. Either way you'll need to make sure that the user account used by IIS to access your files has at least NTFS read permissions to all of your files once they are in place.

In this guide we'll place the phpMyAdmin files in a directory called "pma" under the root directory of a website "example.com". Because phpMyAdmin enables you to directly manipulate, and even delete entire databases and users, it is highly recommended that you secure your phpMyAdmin installation using SSL. This can be done by purchasing a certificate from a 3rd party vendor which will cost money, or by creating self signed certificate for IIS yourself at no cost. With all this in mind, then to access the phpMyAdmin installation used in this guide you would type the following into the address bar of your favourite web browser;

https://example.com/pma

Obviously you'd need to alter this URL to reflect your own installation.

PHP Settings

phpMyAdmin uses several PHP extensions to perform its various functions. The extensions you'll need for phpMyAdmin are;

  • MySQL (to connect to the MySQL server on my web hosting)
  • MCrypt (highly recommended for performance when using the cookie authentication method, and actually required for 64-bit environments)
  • MBString (used for multi-byte character support)
  • GD2 (image creation and manipulation library)

To enable these extensions open you php.ini file and navigate to the list of extensions and find these extension names;

;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mysql.dll

Simply remove the semi-colon (;) from that start, save the file and restart IIS to reload your PHP environment. These extensions should now be loaded into your PHP environment, and can be verified using the phpinfo function as described in the PHP installation guide.

Comments

Anonymous's picture

Very helpful

I just got phpMyAdmin installed perfectly following your guide .. & I just wanted to thank you .. So,

Thank You ..

Brashquido's picture

Thanks for the comment.

Thanks for the comment. Happy the guide was able to help out!
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

Can't seem to get this working

Hi,

First of all i would like to say that this tutorial is one of the most detailed ones I've come across...
I tried many tutorials and finally tried yours...

I've got the MySQL and PHP running... No probs there.
But when I unzip the phpmyadmin to a folder, make the changes to the config file and try to open the site. the troubles start...

Sometimes it opens, sometimes it doesn't. It also doesn't show the nice colors it normally has.
When I give in the credentials for the MySQL it tries to login... but no effect. It seems to hang or gives me the page not found error. After I got this error The site doesn't load at all. I need to reboot the IIS to get back some action...

I downloaded and installed:
mysql-essential-5.0.45-win32.msi
php-5.2.4-Win32.zip
pecl-5.2.4-Win32.zip
phpMyAdmin-2.11.1.1-all-languages.zip

I also have ActivePerl installed... maybe that's the "badass"?

This all I've got installed on a clean W2K3 Server machine with all updates, .NET Frameworks and IIS notging more...

Do you have any idea?

Thanx

Brashquido's picture

Sounds like a permissions

Sounds like a permissions issue to me, maybe something to do with your PHP environment. Sorry I don't have an answer off the top of my head, so it looks like we're going to have to do some digging. Things I would check are;

- Event Viewer
- PHP Log
- IIS Log files

----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

Thank You for your quick reply

I checked the Event Viewer and this it wat it said:

2 errors eventid 2214 and 2268
2214 says it can't load the php_mysql.dll
2268 says it can't load all the isapi filters

I'm not sure where to find the PHP log or the IIS log...

But i know i need to do something about the 2 errors I mentioned before.
Not sure how to fix it.
I'll keep you posted.

Thanx a lot for the help already :-)

Kindest regards,

Stijn

Brashquido's picture

Ok, first thing I would be

Ok, first thing I would be doing is double checking the extension_dir directive in php.ini, and perhaps try entering the absolute path if you haven't done so already. Also make sure you only have the bare essential PECL extensions loaded (as described in the guide) until this is sorted.

Your php log is defined in your php.ini file, and your IIS log files are located by default in %windir%\system32\logfiles
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

It Works !

Thanx a lot for the help.
I completely uninstalled PHP and reinstalled PHP.
PHPMyadmin afterwards wasn't a problem anymore.

Great help, good tutorial.

Thank you,

Kindest regards,

Stijn

Brashquido's picture

Thanks for notifying me

Thanks for notifying me yeutragop. Should be fixed now.
----------------
Dominic Ryan
4 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

yeutragop's picture

The Tutorial is no longer

The Tutorial is no longer there can some one please repost it thanks so much for your time

Best Regards,

yeutragop

Anonymous's picture

help im lost

this is it i can figure out everything installed but i cant get to myadmin. im new to server but not to the program. i can see phpinfo but when i got php myadmin i get Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. im not sure about the logs either.please in you can help me. other than that i love ur guieds there great.