Creating a localhost in Windows (Part 4: Installing phpMyAdmin)

63

Your Localhost is very nearly complete, we’ve installed Apache, PHP 5 and MySQL 5. I breifly talked about the ability to modify and change MySQL databases. Well phpMyAdmin can do just that, this tool allows you to do this, it helps you manage your MySQL database in a nicely presented admin panel which you can easily change tables, prefixes and much more. This tool is a must if you plan on creating databases on your localhost

Before we begin make sure you have read part one, two and three of the Creating a localhost in Windows series.

Step 1: Downloading phpMyAdmin

First off all your going to need to the phpMyAdmin files you can get them from the official PHPMyAdmin website but to save you time, here’s the direct link to a download mirror:

Click to download PHPMyAdmin

Once you have downloaded the files make a new folder called phpMyAdmin in your DocumentRoot. Remember your DocumentRoot is where Apache will look for files on your localhost. We specified this in part one mine was C:/localhost/public_html, what ever your is create a folder called phpMyadmin within in it and extract all the files to that folder.

You should now have a folder sitting within your public_html called phpMyAdmin looking like this:


location


location

Step 2: Config.inc.php file

Now that you’ve placed phpMyAdmin on your localhost you will now need to open it up and find a file called config.sample.inc.php this has all the configuration code needed so you can simply copy it and rename it or simply rename the sample file, I’d copy it so you have a basic template incase everything goes wrong! Rename to Config.inc.php.

There are a few lines in the config but the main ones we need to focus on are:

$cfg['blowfish_secret'] = ''; /* Secret word or phrase for authorization with cookies. This is not your password */
$cfg['Servers'][$i]['host'] = 'localhost'; /* Host is localhost */
$cfg['Servers'][$i]['controluser']  = 'root'; /* Main MySQL Database user is root*/
$cfg['Servers'][$i]['controlpass'] = 'mypass'; /* Password to MySQL */

Blowfist secret: Is simply a keyword or phrase you add in to authenticate sessions, put in anything you like
Host: Where your host is located, and seems we’re setting up a localhost, the host is localhost!
Control User: 100% that control user is root
Control Pass: When you set up MySQL during the various setup screens if you inputted a password you must place it in

If you didn’t have some of those lines in your config add them in, otherwise just modify the current ones. Now you have nearly set up phpMyAdmin

Step 3: Solving a few errors when you first access phpMyAdmin

When you first access phpMyAdmin (For me it’s http://localhost/phpMyAdmin) I was presented with a issue:


mcrypt

And then when I logged in to phpMyAdmin I got a few more:


extensions

**Note error 3 blowfish_secret only appears if you didn’t add one in on your config.inc.php, just add a word or phrase in to get rid off the error.

To solve the mcrypt error:

A error is occuring with the mcrpy extension as it is not enabled by default, hence why it’s giving out the error of can not load. To solve this you will need to edit your PHP config file and go to line 624, you should see this:

;extension=php_mcrypt.dll

Remove the ; and save the config changes. You will then need find the file libmcrypt.dll in your php directory. It is located in the root of your php folder. Copy it over to C:/Windows/System32. You will need to restart Apache for the extension to be loaded (Doing this you may also be logged out of phpMyAdmin and required to login again)

Now the extension is being loaded and the error should of disappeared!

To solve the mbstring error:

There is also an error about a file called mbstring.dll is missing, this is half true, it isn’t loaded because it’s not in the right place but you do have it. If you open your PHP directory and look the ext folder you should see the file php_mbstring.dll

Open your PHP config, go to line 623 you should see this:

;extension=php_mbstring.dll

Remove the ; and save the configuration. Now open your PHP directory and look in the ext folder for the file php_mbstring.dll copy this over to your C:/Windows/System32 folder. You will then need to restart Apache for the extension to be loaded. Log back into phpMyAdmin and all of your errors should of disappeared.

Congratulations! You have set up phpMyAdmin on your localhost, you can now create, modify and delete any MySQL databases, you now have full control over them! To test out MySQL and phpMyAdmin why not installed a script that requires a database to functions and see how it goes! Well thats it for the Creating a Localhost in Windows series, a total of four parts and over 3000 words of explaination written, I hope it helps you set up your onw localhost! If you have any problems or issues feel free to contact me at the usual address!

Share This:

  • Tom

    Thank you very much for writing this four part tutorial. Very, very helpful.

    • No problem Tom and Denis πŸ™‚

  • Denis

    Thanks a lot!

  • Abhinav

    Hi James, thank you so much for the steps involved in set up of a local host. It really helped. I was successful in doing as mentioned till Part 3. While working on Part 4, I extracted the files to phpmyadmin folder under the local host and further did the configuration setting. However, I am not able to see the login page, instead, the phpmyadmin index is appearing. Could you plz advise on this…?..ty…..Abbi

    • Hi Abbi,

      Did you extract the phpMyAdmin folder within your public_html so the path to it is:

      C:/localhost/public_html/phpMyAdmin

      ?

  • Abhinav

    Hey James,

    Yes, it is extracted within public_html folder as: C:/localhost/public_html/phpMyAdmin.

    When I put – http://localhost/phpMyAdmin/ in the URL , it shows the folowing :

    Index of /phpMyAdmin

    * Parent Directory
    * CREDITS
    * ChangeLog
    * Documentation.html
    * Documentation.txt
    * INSTALL
    * LICENSE
    * README
    * README.VENDOR

    • Abbi,

      Did you change your directory index line in part one of the tutorial in your Apache configuration file. I think you are getting the index of phpMyAdmin page because Apache doesn’t know to look for files named index.php or index.html etc. In your Apache configuration look for the like that says Directory Index and change it to:

      DirectoryIndex index.html index.php

  • Abhinav

    While doing a workaround, I used the URL as : http://localhost/phpmyadmin/index.php and it worked, I was able to see the login page. However, when I attempted to login it says :

    phpMyAdmin – Error
    You should upgrade to MySQL 5.0.15 or later.

    It seems that until I install MySql 5, phpmyadmin will not work. I am having mysql 4. Well in that case I have the option to create database using command prompt.

    Anyways, thanks a lot ! Article is really useful πŸ™‚

  • Abhinav

    James,

    As advised by you, I checked for Apache Config file and updated the Directory Index with index.php. Its working fine now. Thank You !!

    • No problem πŸ™‚

      Enjoy your localhost setup πŸ™‚

  • LivinDeadGurl

    Great Tutorial..
    One question though, I have removed the ; from the file specified so that the mycrypt error stops, and i have also copied the required files to system32 but im still getting these errors. Any ideas? Im going to keep working on this, and if I get it, ill repost πŸ˜‰

    Thanks,
    Melisa

    • Hey Mellisa

      If your sure that you have loaded the correct extensions, then it maybe be possible that you need to clear your browsers cache. Your browser snapshots website pages and stores them so they can be accessed quicker later on, but this snapshot can become old and somethinga new changes aren’t displayed. This could of happened with your phpMyAdmin page, if you viewed it when it had errors then the cache could have a old snapshot of when there we’re errors on the login in screen. To clear the cache press ctrl + F5 on your keyboard, when you are on your phpMyAdmin screen

      Good luck πŸ™‚

      p.s. Just wanted to make sure but you did restart apache after adding those extensions didn’t you?

  • Jim

    The best yet!! It took me so much time trying to get this all setup with all different errors but once I found your blog, it was perfect. Thanks!!

    • Then im glad you found my blog πŸ™‚

      Enjoy your localhost!

  • Pingback: Creating a localhost in Windows (Part 4: Installing phpMyAdmin) - Tutorial Collection()

  • Chris

    I have Windows XP with Apache and PHP working fine. I would like to start over with MySQL but no matter what I do I get error 2003, security settings cannot be applied. I may have typed in a password with the original installation, but I’ve been fighting this for so long I can’t remember. I’ve tried several uninstalls to no avail. I have done everything but delete the installer package. Is there a way to start with a clean slate? I found your tutorial very useful and I would like to follow it from the beginning.

  • Very strange. Not to sound pompus but did you follow the steps I did on this tutorial, I say that because how I set up it up can differ to people and how they want MySQL to behave if you head over to:

    http://blog.jmwhite.co.uk/2009/02/15/creating-a-localhost-in-windows-part-3-installing-mysql-5/

    And follow my steps when setting up MySQL. Don’t forget when uninstalling a service like MySQL a full reboot is most likely required to clear anything.

    Let me know if your still having problems.

  • hello James,
    im having a slight problem, everything seems to be working fine, i have managed to get the php screen up on my broswer however following your guides 3 and 4 the end product doesn’t show, i cannot see the login for phpmyadmin, the browser just hangs saying ‘waiting for local host’ i have tried restarting the apatche and i have also copied across all the files into the system32 for the errors you have specified however nothing seems to solve this.

    any ideas?
    thanks
    Tomas

  • Hi Tom,

    Not to worry, im here to help. Glad you get PHP setup, thats half the battle. Can I confirm that MySQL is indeed working? In step 3 there is a basic MySQL connect at the end of the tutorial. Can you tell me if it worked or not. If not then this could be the reason why phpMyAdmin isn’t working if the actual MySQL service isn’t functioning correctly.

  • I have removed ; from ;extension=php_mcrypt.dll and saved the PHP config file in the PHP Directory and restarted the Apache but i still get this Error: Cannot load mcrypt extension. Please check your PHP configuration.
    I have tested my sql in step3 and it is working properly! I really need help what can i do?

    • Tshepo when you removed the ; from the extension did you copy the libmcrypt.dll file to your C:/Windows/System32 ?

  • Morning James!

    Yes i did copy the libmcrypt.dll file to C:/Windows/System32!

  • The problem might be is that phpMyAdmin has been cached by your web browser when the mcrypt error is still appearing. When you view phpMyAdmin on your localhost e.g. http://localhost/phpMyAdmin wait for the page to fully load and then press Ctrl + F5 on your keyboard to clear your cache and see if the error disappears then.

    Let me know how that goes

  • Nothing happens the error still appears!

    • Have you restarted Apache after adding all of the .dll files and loading the extensions by removing the ;?

  • Yes i have done all of the steps including restarting Apache and i have repeated them 5 times but nothing happens, dont know what to do?

    • Can I ask what operating system you are running, which version of Windows.

  • Im running windows 7 Ultimate!

  • Good Day James!

    The problem has been solved! i copied the libmcrypt.dll file to C:/Windows not C:/Windows/system32 and everything went just fine.

    Thanks

    • Glad you got it working. This tutorial series was written long before Windows 7 and even before Windows Vista was seriously being used so I can’t say for certain that things will work 100% on any other operating system that is newer than Windows XP.

  • Hay James!

    I need help on editing a joomla templete will u be able to help me or should you atleast refer me to somebody you know?

  • In attempting to install phpMyAdmin on my widows XP machine, I find that the dlls mentioned are not to be found. Searching for them on the top search engines results in sites I have not heard of an therefor do not truest without source code I can review and compile. The code shown for php.ini (at one time lines 62x ) is not in the current php.ini at all. A search of the entire drive containing all php/web files returns no *crypt*.dll files at all.

    Where can one obtain a trust worthy copy of libmcrypt.dll? SourceForge has a tar.gzip file, but .tar tends to indicate this is not for windows (and as an aside why do *nix folk keep *both* tar and zip?)

  • Pingback: The Art Of War()

  • Pingback: natural ways to improve erection()

  • Pingback: lose love handles fast()

  • Pingback: Check Your Google Pagerank - Website Ranking Checker()

  • Pingback: The Secret Tool Blog Owner's Should All Have()

  • Pingback: StarHosting24 | Free Domain With Any Web Hosting Plan()

  • Pingback: Check how i met 3 girls ready to fuck in my city!()

  • Pingback: facebook 123()

  • Pingback: Good Dog Food()

  • Pingback: nude kim kardashian()

  • Pingback: Frein()

  • Pingback: facebook123()

  • Pingback: Free VLC Player Download()

  • Pingback: Inspired By Nature()

  • Pingback: seo()

  • Pingback: help about ipad()

  • Pingback: Lotto Black Book()

  • Pingback: Buy Facebook Fans()

  • Pingback: Prestashop Templates()

  • Pingback: Become a Video Game Tester()

  • Pingback: Paint Sprayer Reviews()

  • Pingback: Buy Guaranteed Facebook Fans()

  • Pingback: KΓΌnstlicher Weihnachtsbaum Informationen()

  • Pingback: Buy Guaranteed Facebook Fans()

  • Pingback: Buy Guaranteed Facebook Fans()

  • Pingback: Best Kitchen Faucet()

  • Pingback: Buy Fan()

  • Pingback: Buy Targeted Facebook Fans()

  • Pingback: cafelearn72()

  • Pingback: Here()

  • Pingback: Ranking Your Website in Google()