Articles
Install and configure phpMyAdmin on IIS
Creating you phpMyAdmin config file
First thing to do is to create your config file. To do this the easiest way is to copy the config.sample.inc.php file in you phpMyAdmin root directory and rename it to config.inc.php. Using this sample config file as a base means there are literally only a handful of settings that need to be added or altered so that you have a working configuration. Of course there is a lot more you can customise once you get more comfortable using phpMyAdmin. Now to the settings;
$cfg['blowfish_secret'] = '';. In this guide we will be using cookie authentication which requires that you set a pass phrase which is used to decrypt your browser cookies. Keep this as secure as you can by using upper and lowercase, and even make it alpha numeric for good measure. You will not have to remember this pass phrase once set, but don't over do it as it has a limit of 46 characters.
$cfg['Servers'][$i]['controlpass'] = 'pmapass';. This is the password used by the phpMyAdmin account used for all kinds of MySQL administrative functions, so it is a very good idea to change this to something other than the default. Again, you won't have to remember this password, so try and make it a strong one using upper and lower case with a mixture of alpha numeric characters. While you are here, you'll need to remove the double forward slashes (//) from all the configuration directives that are used for the phpMyAdmin user and database. This includes lines 37 through to 48.
$cfg['UploadDir'] = '';. This option allows you to specify where SQL scripts uploaded by users are stored. What I'd suggest you do is create a directory in your phpMyAdmin root directory called "user_data" or similar, and then make sure it is writable by IIS. To do this right click on the directory you just created, select properties and select the security tab, then click the add button and enter IUSR_COMPUTERNAME, where COMPUTERNAME is the actual name of the computer you are working on. Click OK to add the user and then select the read and write permissions with the IUSR user selected. Click OK again to apply the permissions. If you are setting up phpMyAdmin for a multi user environment, then it would be very advantageous for you to be able to seperate user uploads into their own directories. To do this, manually create a directory inside the main upload directory for each user, and then you can use the %u variable so that phpMyAdmin automatically redirects users to their own directories. For instance, using this %u variable this upload directory directive would look something like $cfg['UploadDir'] = 'user_data/%u';.
$cfg['SaveDir'] = '';. This directive specifies where SQL export files are saved when using the "save on server" option in phpMyAdmin. You can set this to a separate directory, but more often than not I find it more convenient to set this directive to exactly the same as the upload directory above. The reason for this is when you go to import a SQL file you have an option to upload the file, or select a file from the upload directory. Working with large databases will almost always mean you are limited by you PHP environment when uploading SQL files as you maximum file size is limited to the PHP max post size setting, and also the PHP maximum script execution time. However if the save directory is the same as the upload directory and you are using the %u variable, then when you export a database to an SQL file and save it on the server it is already in your upload directory ready to be imported, and by using the %u variable means that you'll only ever see your own SQL export files. One last piece of advise here is that when compressing your SQL export file (which is a very good idea), be sure not to use zip. This is because zip is processed all in memory and you run the risk of hitting your PHP memory limit, not to mention loading your server. If you use the gzip option, then compression is done on the fly. I've found gzip usually gives better compression results anyway.
With these main phpMyAdmin configuration directives set, then you can simply copy and paste these directives under the save directory setting;
$cfg['docSQLDir'] = 'docsql';
$cfg['ShowPhpInfo'] = true;
$cfg['ShowChgPassword'] = true;
$cfg['AllowArbitraryServer'] = false;
$cfg['LoginCookieRecall'] = 'something';
$cfg['LoginCookieValidity'] = 1800;
$cfg['AllowAnywhereRecoding'] = true;
$cfg['DefaultCharset'] = 'iso-8859-1';
$cfg['RecodingEngine'] = 'iconv';
$cfg['IconvExtraParams'] = '//TRANSLIT';
$cfg['GD2Available'] = 'yes';
$cfg['CheckConfigurationPermissions'] = FALSE;
$cfg['Servers'][$i]['hide_db'] = '(information_schema|phpmyadmin|mysql)';
From here you should actually be able to log into your new phpMyAdmin installation by entering the root username and password into the login screen of your phpMyAdmin installation URL. Might be a good idea to do that now to make sure everything is going to plan. be aware that there will be a good many features not available until we complete the install.
- Add new comment
- 272359 reads

Comments
Very helpful
I just got phpMyAdmin installed perfectly following your guide .. & I just wanted to thank you .. So,
Thank You ..
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
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
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
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
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
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
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
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
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.