April 19th, 2009
Tutorial : Installing Apache 2.2.11, PHP 5.3, MySQL 5.1.34 & PhpMyAdmin 3.1.4 in Windows Vista/XP
The most recent version of this tutorial has been completely re-written at WebDev Codex.
Learn how to Install PHP 5.3,
To view the latest version, Goto Screencast #1 : Installing Apache 2.2, PHP 5.3, MySQL 5.1 & PHPMyAdmin 3.2 for Windows 7/Vista
If you want to see the screencast of this tutorial, then goto
Screencast #1 : Installing Apache 2.2, PHP 5.3, MySQL 5.1 & PHPMyAdmin 3.2 for Windows 7/Vista
Not everyone would spend money online to buy webspace just so that they can test out how their latest application works, Well… Welcome to Vision Master Designs Blog. This tutorial will teach you to set up a developer environment for PHP/MySQL in your computer in no time.
Index :
- Page 1 : Introduction
- Page 2 : Create Directories & Install Apache
- Page 3 : Install PHP5 & Configure php.ini
- Page 4 : Configure Apache 2.2
- Page 5 : Installing & Configuring MySQL5
- Page 6 : Installing & Configuring PhpMyAdmin
If you are aware of the basics then Click Here to jump below, else read on.
Normally we can view HTML pages on our computer without the need of uploading them to the server, since HTML is a Client Side Language. You don`t need any extra software to view html files, just any browser will do the trick.
But if you want to make your pages dynamic using any Server Side Language (PHP,ASP,JSP) & want to the see the results then you must upload the file to the webserver which supports that language so it can execute the file & return the results on your browser
We can set up a developers environment from which you can create and execute PHP/MySQL scripts by installing the above mentioned applications.
- Apache HTTP Server (2.2.11): The best open source webserver. You need this to turn your humble computer to a powerful webserver to execute your applications.
Direct Download apache_2.2.11-win32-x86-no_ssl-r2.msi
Apache Download Page – Please Download the Win32 Binary without crypto (no mod_ssl) (MSI Installer) – apache_2.2.11-win32-x86-no_ssl.msi~ 4.3MB - PHP (5.2.9) : One of the most powerful web programming languages.
Direct Download PHP 5.2.9 -2 zip package
PHP Download Page – Download the PHP 5.2.9 – 2 Zip package ~ 10MB - MySQL (5.1.34) : One of the best DBMS packages which is free.
The latest version is 5.1.34 which is stable and used in production servers. Although MySQL 5.1 and MySQL 6 are also available as beta releases, they are not used in production servers as of now.
MySQL Download Page – Please download Windows ZIP/Setup.EXE (x86) 5.1.34 ~ 35.2MB - PhpMyAdmin (3.1.4) : Used to manage your MySQL databases directly using your web browser.
Direct Download phpMyAdmin-3.1.4-all-languages.zip
PHPMyAdmin Download Page – Please download the latest release from the 3.x rooster.
The above downloads are compatible with Windows Vista/Vista SP1 (32 bit OS).















August 9, 2008 at 12:58 am
I am unable to save the hosts file after edit. Everything else was installed per instructions. The browser does not point to the myserver.dev
August 8, 2008 at 5:55 pm
Hello Raghuvir,
Since you are behind a firewall, Do you use proxy ?
I would suggest you disable your firewall for a minute or so and then check.
By the way which browser do you use ?
try pointing to http://myserver.dev instead of http://www.myserver.dev
Sometimes http://www.myserver.dev shows a forbidden error.
Lemme know
Regards
August 8, 2008 at 5:35 pm
Hey Micheal,
First of all, Great tutorial. Haven’t come any tutorial as good as this till now.
Now. I’ve followed every step of yours. Perfectly ( i presume ). Also I have gone through every comment to see if I have any company in terms of the problem that I am facing. But to of no avail.
The error that I am getting is
Bad Gateway
The following error occurred:
[code=DNS_HOST_NOT_FOUND] The host name was not found during the DNS lookup. Contact your system administrator if the problem is not found by retrying the URL.
I have done everything that you have asked me to.
No it is stored as .php and not a .txt
copied all the .dll files into sys32 and also Windows folder.
Have gone through all the steps carefully. But, I haven't turned off my firewall. Because all of my work on PHP needs a firewall.
My small moment of joy was when I saw It Works !
And nothing ever since has showed any signs of it working.
Thanks a lot. It might be a lament doubt but its inevitable for me to get it working.
Thank you.
August 8, 2008 at 3:42 pm
Woho, now it works.
Thnx for the guide =)
August 8, 2008 at 3:27 pm
Hi Michael.
I’ve followed your guide step by step and I have no problem, but now I’m on page 5. But I can’t even se page 5, it only shows crap.
http://www.visionmasterdesigns.com/2008/07/tutorial-installing-apache-php-5-mysql-5-phpmyadmin-windows-vista-xp/5/
Here is the first two lines i see, but the page is filled with it:
????vG?-?l?Q????&e? P?????$[[??U???N n?D?{???????1?{???3?Z????Rl?\ dFF?e??5????zv???????^?????3/??f)>?f??<??????K/??y’#?v?A??f???????x<?e??????bf0jgO?d???L?w??^f??g??L# S?a?_~???G7FA?O???t?????{G?????:;????|’?h?u~??
//Erik
August 8, 2008 at 12:01 am
If you us the mysqli_* set of PHP functions instead of mysql_* then it seems that MySQL 5.1.26 is ok. Using the older interface crashes.
Haven’t tried using phpMyAdmin with this, but my own CakePHP app works fine with Vista, Apache 2.2.9, PHP 5.2.6, and MySQL 5.1.26.
August 7, 2008 at 7:50 pm
Wow – this is great. I tried to do this myself a few months ago but came to a grinding halt. I’ve just done the whole installation in under an hour using your tutorial and it’s all working perfectly. Thanks very much!
August 5, 2008 at 10:43 pm
Hey Aggy,
Your problem seems a bit odd. It would really help me solve your problem if you can send me your php.ini ,httpd.conf files.
you can send them at admin@visionmasterdesigns.com
Regards
August 5, 2008 at 10:08 am
Hi,
I went back and verified, but still get HTTP 404 Not Found at http://www.myserver.dev/pma/index.php. Same thing at http://myserver.dev/index.php. Yes, I moved all content in phpmyadmin into pma folder, and double-checked the php.ini and httpd.conf files. Did change to system Environmental Variables. Restarted server. It’s as if something is stuck between apache and php… Appreciate your help.
August 5, 2008 at 9:11 am
I finally got it running. Started fiddling around with XAMPP (which I haven’t gotten to work), and saw the directions at the bottom of the page here: http://www.apachefriends.org/en/xampp-windows.html#641
Thanks, now I guess I’m on to the next step.
August 4, 2008 at 8:05 pm
Hello Brandon,
Your problem seems odd…
for more details on phpmyadmin (install) visit
http://www.visionmasterdesigns.com/2008/07/tutorial-installing-apache-php-5-mysql-5-phpmyadmin-windows-vista-xp/6/
to learn to use phpmyadmin
http://www.visionmasterdesigns.com/2008/07/tutorial-using-phpmyadmin-to-manage-mysql/
Regards
August 4, 2008 at 8:03 pm
Hello Aggy,
You have to restart your server after making changes to the php configuration files.
BTW you cannot access the php.ini file by pointing to http://www.myserver.dev/php.ini, if you want to access index.php then point your browser to myserver.dev/index.php
I hope you have configured your php.ini file, made changes to the system Environmental Variables and added the php modules in the httpd.conf file inside the apache/conf folder etc.
If you follow the tutorial step-by-step, it should work fine.
BTW about phpmyadmin,
your files must be present inside
C:\server\www\myserver.dev\public_html\pma
Most of them while extracting the files the extracting program tends to add another folder like
C:\server\www\myserver.dev\public_html\pma\phpmyadmin2.11\
please see to it that you extract your files and all the files are present inside C:\server\www\myserver.dev\public_html\pma
Regards
August 4, 2008 at 4:13 am
Awesome, it works!
Thanks Michael!
But it might just be me, but when I click on any of the links (page 1 – page 6) it just brings me back here. Is it supposed to do that?
I downloaded phpMyAdmin, but how do I access it, or at all use it?
August 4, 2008 at 1:50 am
I followed steps 1-6. “I get Page cannot be found” at http://www.myserver.dev/pma/index.php Thanks for your help.
August 3, 2008 at 11:47 pm
Hi,
Great tutorial! Best of many I’ve tried!
Need help with PHP. I followed each step 1-4 but still having trouble with PHP. I get “It works!” at http://www.myserver.dev/. In the bottom-left corner of Apache Service Monitor, it only says “Apache/2.2.9 (Win32)”. Get “HTTP 404 Not Found” at http://www.myserver.dev/php.ini but do have index.php in “C:\server\www\myserver.dev\public_html” (Type of File is “PHP File (.php)”). How can I make Apache to recognize PHP correctly?
Appreciate your help.
August 3, 2008 at 8:12 pm
Hey Brandon,
did you follow the tutorial step by step.
did you do the modify the httpd.conf file inside the conf folder and the associated conf files ?
To check whether you have installed php properly, you can click on the apache icon in the taskbar to check.
Regards
August 3, 2008 at 3:15 pm
Also, if I change the html file under htdocs to a .php with php code inside, it gives me some sort of list of items also inside the folder, as apposed to the index file.
August 3, 2008 at 3:08 pm
Hi,
I’m having a little trouble getting all this to work properly. Actually, a little is an understatement.
I have no idea how to progress from where I am. I downloaded Apache 2.2.9, MySQL 5.0, PHP 5.2.6 (and the .msi), and phpMyAdmin.
I installed Apache fine, as far as I am aware. I installed PHP and selected the ‘conf’ folder under Apache.
I also installed MySQL and set it up according to the provided wizard instructions.
I then typed in 127.0.0.1 into my web browser and it displayed: “It works!”. This is accessing the Index.html file under Apache/htdocs, I believe.
My problem lies herein. I then tried creating a .php file with an echo code. However, when I opened up said file in a web browser, it did not show up, and I could see my php code in the source.
How do I get PHP working?
Thanks.
August 3, 2008 at 9:26 am
Hmm, well now I have a different response:
Access denied. MySQL said: Documentation
#1045 – Access denied for user ‘root’@'localhost’ (using password: YES)
August 2, 2008 at 6:10 pm
hey kurvmax,
sorry I meant ‘php.ini-dist’.
do backup the php.ini file. also try copying libmysql.dll to your windows folder as well as your system32 folder.
also please check your extensions folder, I hope you have set the proper directory in the php.ini file. (assuming it is C:\server\php\ext )
if it is still not working, email me your php.ini file at rowoot@gmail.com
Regards
August 2, 2008 at 1:16 pm
Hi Michael,
Thanks so much for this tutorial, I could install and configure all the required packages without issues.
Much appreciated !
August 2, 2008 at 12:59 am
Wasn’t that already one of your directions? I don’t have a php.ini-recommended anymore. It was renamed to php.ini.
And yep, it was the latest.
August 1, 2008 at 9:41 pm
hey newbie,
Which page are you talking about ??
August 1, 2008 at 7:06 pm
Dude, you seem to be one bad coder!
Kidding.
So, i’ve loaded your page in Firefox 3, on click (next page) the browser freezes, my best bet is that when you create the XMLHTTPRequest your last option was ‘false’. If you know AJAX, I guess you know exactly what I mean
August 1, 2008 at 6:46 pm
hey kurvmax,
I hope you have downloaded the latest php zip package !
anyways
you can do one thing, (back up the current php.ini) then delete the php.ini file, then rename the file called php.ini-recommended in your php folder to php.ini !
then add and do all the modifications as mentioned in the tutorial !
Regards
August 1, 2008 at 3:21 pm
So I went through this again and now it says:
“Cannot load mysqli extension. Please check your PHP configuration.”
I’m ready to just use XAMPP. Haven’t tried it yet; does it impose limits on me?
I’ve already made sure that the extension is uncommented, and the slash marks are forward.
July 30, 2008 at 11:58 pm
Hey Kenny,
please check whether is this what you have added in the httpd.conf file ?
and put the code in the ‘end of the LoadModule block inside the httpd.conf file’.
# PHP5
LoadModule php5_module “F:/server/php/php5apache2_2.dll”
PHPIniDir “F:/server/php”
please note, as above is how the code should look. If you are having problems still, please check the path variables to see whether C:\server\php\bin is present there.
Regards
Mike
July 30, 2008 at 10:03 am
Michael,
I get a error message ” cannot load C:/server/php/php5apache2_2.dll” after make changes in httpd.conf. Please advice.
regards,
kenny
July 30, 2008 at 2:28 am
Michael,
I am trying to use a database (I believe it was created using phpAdmin) on another computer. The database is named “attendance”. I would like to transfer it to the computer I set up using your tutorial.
I think the correct folder in the other computer is:
c:\mysql\data\attendance
How (and where) can I transfer it to my installation so I can can query it using either myphpAdmin or directly using mysql?
Thanks again for y+our help!
–Elliot
July 30, 2008 at 1:39 am
as I said…I read the guide couple of times….besides the first page
it worked! I noticed only now that the file was in the “www” folder instead in “public_html”.
Thank you Michael!
July 29, 2008 at 10:35 pm
Hello Tal,
did you put the ‘index.php’ file inside public_html folder ?
if you have put the php file, then when you access http://myserver.dev/index.php you should see the php info
put all the files in public_html and then you can access thru http://myserver.dev/
Regards
July 29, 2008 at 9:38 pm
Hey Michael
I know this topic had been discussed before, but I relly dont kow what do to anymore.
I have read the guid a couple of times and double checked everything, however I’m still getting “Index of” page when trying to access to http://www.myserver.dev. There are no files in the page just a headline – “Index of/” and a blank page.
Apache server is working, I have a green light and got the “it works” page and explained in the guide.
Windows PATH has:
C:\server\php;
C:\server\php\ext;
C:\Program Files\MySQL\MySQL Server 5.0\bin
and extension_dir = “C:/server/php/ext”.
Thank you.
Tal
July 29, 2008 at 5:59 pm
Hey Elliot,
Which databases are you talking bout ??
In this installation, phpmyadmin creates databases in mysql.
phpmyadmin is just a GUI manager for mysql.
You can manage your databases through command promt as well, but its just that phpmyadmin makes my life easier since it is GUI based.
If you want to know how to create databases using phpmyadmin, then I suggest you read Tutorial : Using phpMyAdmin to manage mysql – http://blog.visionmasterdesigns.com/2008/07/tutorial-using-phpmyadmin-to-manage-mysql/
Regards
Michael
July 29, 2008 at 5:01 pm
Can I get some help from anyone? I installed everything and it all seems to work. But I’m having trouble locating databases? In this installation, where are the databases created by phpMyAdmin stored on the hard drive?? I thought it was supposed to be in a folder called “mysql”, but I can’t find anything like that!
THANKS for any help!
July 28, 2008 at 9:00 pm
Hey andres,
If you try to access using ‘www.myserver.dev’, sometimes you might get a HTTP 403 error.
try accessing with this type ‘myserver.dev’ , stop adding the www in your url , it does help in some cases.
And please disable your firewall,defender etc etc. Sometimes they are also the culprit
Regards
July 28, 2008 at 8:44 pm
Michael, thanks again! I find the way…to make things worst! I try dreamw, but “HTTP 500 Internat Error”. I checked apache as you suggested and it´s OK. Could it be Windows Vista that hates me? Why?, i´m a good to it! :S
July 28, 2008 at 3:59 pm
Hey David,
No problem, BTW the phpmyadmin article is published, do check it out.
I do suggest you subscribe to the feeds that way you`ll be updated if any new articles are posted !
Regards
July 28, 2008 at 3:57 pm
Hello Andres,
Please see to it that you have saved the file as ‘index.php’ not ‘index.php.txt’ since notepad always tends to save as a .txt file even though you give the file an extension.
i suggest you use some other program like dreamweaver or so.
BTW just to verify that your php is working properly, double click on the apache icon on the taskbar. If the status bar reads Apache/2.2.x (Win32) PHP/5.2.x then php is insalled properly.
Regards
July 28, 2008 at 4:06 am
Hey Mike,
I will keep a lookout for your phpMyadmin tutorial.
In the meantime, I would like to express my gratitude for both the tutorial and the patient way you helped my iron out the issues I had.
Thanks and maximum respect,
David
July 28, 2008 at 3:19 am
Great tutorial! I´m 100% novice. I did all steps without problems, but…
when I create a php file, saved in public_html directory (where it is saved the index.php that work!) with the same text as the index.php file I get a blank page in my IE browser. No error, nothing. Just blank! Please please help me! Thanks again
July 27, 2008 at 11:16 pm
Thank you Elliot ! It means a lot
July 27, 2008 at 10:39 pm
Great tutorial for an incredibly complicated installation (for novices).
Thanks!
July 27, 2008 at 2:39 am
hey michael great compilation and very good tutorials for newbies.thank you so much..
July 26, 2008 at 6:45 pm
Hello Abere,
I suggest you put a file inside the public_html folder & then try opening that file using http://www.myserver.dev/filename.html
Sometimes apache doesnt let you see the root directory files/folders etc.
Regards
Mike
July 26, 2008 at 4:11 am
Hi Michael,
Really!! Thanks for your time and effort, but I already had checked the environmental path, which included everything that was needed. I had not missed a single step.
I refused to turn down firewalls and antivirus as I have always worked with them turned on and had no problems, so I new there was a way without getting to that point.
I finally found the problem.
The solution is to copy the libmysql.dll file (in c:\php directory) to the “windows\system32″ directory.
It turns out that I had an older version of the file copied there from the previous installation.
Just wanted you to know, and maybe can help someone else.
Thanks for everything!!
July 26, 2008 at 3:40 am
My index.php shows nothing. any ideas.
Here is my configuration file.
any ideas guys
July 26, 2008 at 2:33 am
Hey guys when i type “www.myserver.dev” on the webbrowser am getting error “403 Forbidden” what’s the problem. and i have followed all the steps.
Regards
Abere
July 25, 2008 at 9:31 pm
Hey David,
Finally, Great to hear that it works !
Always a pleasure to help
BTW I am writing a tutorial on how to use phpMyadmin. Be sure to check in
Regards
David
July 25, 2008 at 9:27 pm
Great news Mike – it works!
All I did was copy the config.inc.php contents from your last post, and it sprang into life.
Thank you
I do get this message at towards the bottom of the screen:
Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.25. This may cause unpredictable behavior.
…but, I guess this is just highlighting the difference, and is not an issue.
Thank you so much for your patience with me. It is much appreciated.
David
July 25, 2008 at 7:03 pm
This is for EVERYONE having problems with phpmyadmin.
1. Please check the username and password and portnumber in the config.inc.php
2. All the FILES must be EXTRACTED to the ‘pma’ folder i.e ‘pma/index.php’ or ‘pma/config.inc.php’. please donot extract it to ‘pma/phpmyadmin-2.11.7/index.php’ etc
3. “config.inc.php” is the name of the config file. PLEASE CHECK THAT. Normally people create the file with notepad and don`t notice the extension.
4. config.inc.php
Regards
Mike