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).















October 13, 2008 at 12:24 am
Hey Mike,
Here’s my previous posts and your reply:
Me – I’m having an issue with myPHPadmin. I’ve loaded everything correctly. Apache, PHP and MySQL are all running. I even ran the test file you posted above and am connecting to MySQL. When I nav to http://myserver.dev/pma/, I get a blank screen back. No error messages.
I get the following results in my Apache error log:
[Wed Oct 08 00:05:24 2008] [error] [client 127.0.0.1] PHP Warning: Theme path not found for theme ./themes! in C:\\server\\www\\myserver.dev\\public_html\\pma\\libraries\\Theme_Manager.class.php on line 237
[Wed Oct 08 00:05:24 2008] [error] [client 127.0.0.1] PHP Fatal error: Call to a member function getName() on a non-object in C:\\server\\www\\myserver.dev\\public_html\\pma\\libraries\\common.inc.php on line 654
Here is line 237 from Theme_Manager.class.php:
E_USER_WARNING);
Here is line 654 from common.inc.php:
$GLOBALS['theme'] = $_SESSION['PMA_Theme']->getName();
You – There is a error @ line 237. Can you temme which version are you using ?
Try downloading phpmyadmin 2.11.9.2
__LongTerm__
and reinstall following the tutorial.
Me – I was using version 2.11.9 from the download link in the tutorial. I just downloaded and installed 2.11.9.2 and am getting the same results. Blank page, same error logs.
I’ve turned off Firewall and virus scanners, restarted Apache and even rebooted my machine..
Still no luck
October 12, 2008 at 11:41 pm
Derrick,
I use Windows Vista. The screenshots posted in this tutorial are all of Windows Vista. Most of the users have got it working in Windows Vista.
I guess you haven`t followed the tutorial properly or you haven`t got the files right. BTW there is no php5dts.dll … it is php5ts.dll
if you can give more information on what all you have done, perhaps I`ll be able to help
Regards
October 12, 2008 at 10:31 pm
I did EVENTUALLY edit the httpd.conf file. However, what i was trying to actually convey earlier is that in order to run Apache, you will have to revert back to XP, I know this for a fact.
I get the “It Works” message when going to http://localhost, but when I try to restart Apache, it says that it failed and when I go to configure Apache through All Programs, I get a command prompt error that says it can’t load php5dts.dll file when in fact it is there.
Mike, I would just adjust the tutorial to and XP format, or make stipulations, because this won’t work on Vista.
Thanks
October 12, 2008 at 4:05 pm
Collin,
I am really sorry couldn`t reply earlier. Its really tough to keep track of all the queries. Please temme what is the problem again ? I`ll try my best to get it solved.
Regards
October 12, 2008 at 4:04 pm
err…
Derrick, very few users have complained of not being able to edit httpd.conf file.
You can try the following solutions that seemed to work.
*First stop the apache server if it is working*
1)First open notepad. Then via notepad try to open httpd.conf file.
2) If that fails. Use dreamweaver to open httpd.conf file. First open dreamweaver and from there try to open httpd.conf fil
3) If it still doesn`t work, Boot into safemode and then follow the above procedures.
October 12, 2008 at 6:45 am
NOTICE TO DERRICK:
I’m running Vista Ultimate and this tutorial was successful for me. The only thing that hasn’t worked out is my install of phpmyadmin (which isn’t required for your local web server).
You can edit the HTTPD.CONF. If you can’t the problem is with your computer or what you’re using to edit the file (which would be really strange sense it’s just a text doc) . You can open it and save it using Notepad.
I tried following a couple other tutorials before this one and this was by far the best.
NOTICE TO WINDOWS VISTA USERS:
Yes you can!
October 12, 2008 at 4:12 am
NOTICE TO WINDOWS VISTA USERS:
At this time, you cannot set up PHP, MySql, and Apache to create a testing server. Future updates may fix this.
Just trying to save Vista users A LOT of wasted time. You will have to revert to XP.
October 12, 2008 at 12:08 am
Also tried http://www.myserver.dev and everything else. How can all of these people say this is working, when it obviously is not. Also I get a command prompt error screen that says it “cannot load php5apache2_2.dll and that %1 is not a valid win 32 applications.”
for anyone reading this DO NOT WASTE YOUR TIME. this is another tutorial to nowhere…………………………….
October 11, 2008 at 11:42 pm
I did everything exactly, but when I restarted Apache in the moitor panel, it said “The requested operation has failed”. This is at least the tenth tutorial on the net that has failed me. Does anyone know of a tutorial that works? Thanks
October 11, 2008 at 9:27 pm
CANNOT EDIT HTTPD.CONF files. this type of file cannot be edited and resaved. Just thought I would add that to the tutorial.
October 10, 2008 at 2:22 pm
Hi Mike,
Your tutorial is really great. I just follow your instruction and now I successfully established in all the setup.
I will now proceed for creating a simple WebApplication Hope that you have some basic tutorial also. I am looking forward on that, thank you very much.
Kind Regards,
Adrian
October 10, 2008 at 6:52 am
Hi everyone-
I have installed mysql, and when I try to go to myserver.dev I get a 403 Forbidden error “You don’t have permission to access / on this server.”
I have checked and re-checked all the steps involved, and everything is as shown. I have re-configured mysql and made sure the password was set to “root”, and port 3306 is open.
Any thoughts?
October 9, 2008 at 5:20 pm
Hey Alan,
Sometimes it does happen. I would suggest you to first check whether mysql service has started in ur system. You can check by opening command prompt and type
mysql -u root -p
it`ll ask for password, put root (if you have followed this tutorial)
once you are logged in then type
\s
to see the status of mysql service. If its on, then there mst be a problem with your php.ini file. Try enabling the extensions again of your php.ini file
October 9, 2008 at 1:21 am
Hi all,
I found this site the best tutorial online.
I tried to repeat this three times but with no success.
My problem is that mysql is not showing on phpinfo();
I followed all the steps and even tried to put libmysql in
different diectories.
PLEASE HELP
October 8, 2008 at 9:35 pm
I was using version 2.11.9 from the download link in the tutorial. I just downloaded and installed 2.11.9.2 and am getting the same results. Blank page, same error logs.
I’ve turned off Firewall and virus scanners, restarted Apache and even rebooted my machine..
Still no luck
October 8, 2008 at 11:18 am
Hello Collin,
There is a error @ line 237. Can you temme which version are you using ?
Try downloading phpmyadmin 2.11.9.2
http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.11.9.2-all-languages-utf-8-only.zip?download
and reinstall following the tutorial.
BTW phpmyadmin 3.0.0 has been released, I`ll be soon updating the tutorial on how to configure phpmyadmin 3.
Regards
October 8, 2008 at 11:03 am
I’m having an issue with myPHPadmin. I’ve loaded everything correctly. Apache, PHP and MySQL are all running. I even ran the test file you posted above and am connecting to MySQL. When I nav to http://myserver.dev/pma/, I get a blank screen back. No error messages.
I get the following results in my Apache error log:
[Wed Oct 08 00:05:24 2008] [error] [client 127.0.0.1] PHP Warning: Theme path not found for theme ./themes! in C:\\server\\www\\myserver.dev\\public_html\\pma\\libraries\\Theme_Manager.class.php on line 237
[Wed Oct 08 00:05:24 2008] [error] [client 127.0.0.1] PHP Fatal error: Call to a member function getName() on a non-object in C:\\server\\www\\myserver.dev\\public_html\\pma\\libraries\\common.inc.php on line 654
Here is line 237 from Theme_Manager.class.php:
E_USER_WARNING);
Here is line 654 from common.inc.php:
$GLOBALS['theme'] = $_SESSION['PMA_Theme']->getName();
Any ideas why I’m getting a blank page?
Also, thanx a lot for the tutorial. I was banging my head for a couple of days following some others with no luck, But, yours has worked really well and easy to follow. Thanx
October 6, 2008 at 3:03 am
Thanks a million for this beautiful tutorial…it fills out the gaps one could have during the installations…
Thanks again for your time!!!
October 5, 2008 at 11:09 pm
Hey Andreea,
I am glad it started working fine. Njoy developing
Regards
October 5, 2008 at 3:53 pm
Hi,
I solved the problem. I had in hosts file a line “::1 localhost”. I made it a comment, like “#::1 localhost” and it’s working now http://localhost link. Thank you for all your help. The tutorial is very good!
Andreea
October 5, 2008 at 2:12 am
Michael, I tried again and again and now everything is working (I suppose) except http://localhost link. It shows : Connection interrupted etc etc. But when I try http://www.myserver.dev everything is fine, I see php information.
If you have an idea about my localhost I will be happy to hear it.
Regards.
October 4, 2008 at 8:42 pm
Hey Andreea,
I hope you have disabled your antivirus, firewall etc. If you are using Windows XP/Vista, please disable the firewall. Also install Apache as a service from your administrator account. BTW I hope you have done all the editing of httpd.conf file as well.
You should`nt have any problem if you have followed the tutorial. But if you are still having a problem, do let me know.
October 4, 2008 at 11:25 am
Hey Michael,
I was following the tutorial trying to install apache. I did all as you said but still I receive “Connection Interrupted.. etc”
I installed the version you published in this tutorial.
Thank you.
October 4, 2008 at 9:10 am
Hey Andreea,
Thanks for posting in. First off which version of Apache did u reinstall ? Secondly I think apache hasn`t been reinstalled and configured properly.
]I would suggest you to remove all instances of apache (i.e not only from add/remove programs, but also all directories of apache in c:\program files\ ) and they try reinstalling following the tutorial.
Regards.
October 4, 2008 at 2:05 am
Hi Michael,
I just reinstalled Apache and http://localhost is still not working (as the first time I did that). It’s says:
Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try again.
Please give me some advices.
Andreea
October 1, 2008 at 2:04 am
Hi,
i have installed windows xp in spanish, apache is not running.
Give me error “The requested operation has failed!”
September 19, 2008 at 5:34 pm
Hello vakhtang,
This tutorial is intended to get a developer’s environment in ur local system. myserver.dev is a local name, not a domain name, it is only accessible frm ur system not from any1 else’s system.
you can have blahblah.com, but it will only work on ur system, since blahblah.com will only be recognized frm ur system. if you try to access blahblah.com frm outside, it wont work.
you can replace all instances of myserver.dev = blahblah.com from page1 of this tutorial
September 18, 2008 at 6:58 pm
good day!
I’ve done everything. I copied file libmysql.dll to system32 foleder and after that everything works. Now i have one question. Where should i put my new web site? for example i want to create web site blablabla.com where should i create folder blablabla.com so that i could point my brouser to blablabla.com and see my site? when i put it inside C:\server\www\myserver.dev\public_html it work but i have to point my brouser to http://myserver.dev/blablabla.com/ but i want to point my brouser to exact addres to blablabla.com so please help me tell me where should i put foleder blablabla.com?
Thank you in advance
With regards
Vakhtang
September 18, 2008 at 12:17 pm
Hi
You shoud be the journalist with your great talent
September 16, 2008 at 6:21 pm
Hey JJ,
Thats odd,
Do one thing,
boot into safe mode, if apache is on, first off stop the apache server and then try editing the httpd.conf file
Regards
September 15, 2008 at 8:10 am
Please help. I’m trying to modify my httpd.conf file on a vista system, and it keeps telling me that I cannot create the file – even though I am just changing it.
Thanks
September 10, 2008 at 5:42 am
Sorry, I’ll try that again!
Just a heads-up: your code in step 10 has got a little messed up. Line 11 should read <Directory/>
September 10, 2008 at 5:34 am
Just a heads-up: your code in step 10 has got a little messed up. Line 11 should read
September 9, 2008 at 11:29 pm
Hello Stuart,
Since PhpMyAdmin is working fine, I would suggest you to check the username, password and modify as required in the script that I gave you, You Server is all fine though, there is no problem. Just be sure to put the right mysql username & password
Regards
September 9, 2008 at 2:41 pm
Hi Michael,
Great tutorial. While I have used shared hosting in the past and have limited to no experience with servers/mysql etc this was easy to follow.
I did have one problem.
When restarting Apache from the ‘All Programs’ menu after install I got an error about the email address to send problems to:
Syntax error on ine 164 of C:/Program Files/ /Apache Software Foundation/Apache2.2/conf/httpd.conf)
Invalid command ‘admin@myserver.dev’ . Perhaps misspelled or defined by a module not included in the server configuration.
So I removed the email address (admin@myserver.dev) from line 164 and had no problems after that.
One thing I would like to ask you about is the server IP.
I have some scripts that use cURL (I already enabled it in php.ini)
The problem I have is that I use a websites API and they require the server IP that I am running the script from.
As my IP changes every time I re-boot this is not ideal so is there a way to give my home server a static IP?
I use a Linkysys WRT540 router but can’t seem to find any info on this subject.
Thanks
September 9, 2008 at 12:04 am
Hi Michael
Further to my success in getting PHPMyAdmin to work, I note that the test script that you gave STILL returns ‘Error connecting to server!’ when I navigate to myserver.dev/testmysql.php…
Is there still ‘work to do’ or can I go ahead and develop an Apache database and learn PHP?
Your comments would be appreciated.
Yours
Stuart
September 7, 2008 at 1:25 am
i get 403 forbidden error.. i saw all older posts about it and i make all instructions… but not works… all my php, mysql and apache is the exactly version of this tutorial, and my firewall is totaly enable to this programs… what i make to this works…
sorry for my english. tks
September 6, 2008 at 9:04 pm
Thanks a lot guys for your support.
Thanks Yutzmann (Dave) for your precious comments. I have modified the tutorial and added your little mods
September 6, 2008 at 1:53 pm
Michael, kudos on a great tutorial and the fantastic support you’re giving us users.
Based on your help, I’m going to go back to a machine that I installed a “stock” package with clunky UI for apache, php, and MySQL and do it like this tutorial suggests. It’ll be a significant improvement and upgrade.
I’m posting just to mention a few things about the tutorial for those like me who think they know more than the teacher.
1. You MUST MUST MUST reboot a windows box after setting the Path variable (step 2). If you move on past that point without rebooting – logging off is NOT enough – apache will have trouble finding your mySQL extensions. Your phpInfo will not show those extensions and you’ll get an error in the apache log saying it can’t find the extension.
2. During the MySQL install (step 5), if you didn’t select root as the password – a point I missed – you can re-run the configuration and change the password to root using MySQLInstanceConfig.exe in the bin folder of the MySQL application. You can also set to open port 3306 during this re-configure step.
3. When you extract the zip for phpMyAdmin (step6), uncheck the box saying “Use Folder Name”. This will put the extracted files at the root (pma) folder rather than the packaged root. This was an issue that Stuart had trouble with.
Anyway, thanks for great tutorial. I’m definitely subscribing to your feed.
-Dave
September 6, 2008 at 4:58 am
All done…
Check all your apache config files and make sure they’re aimed at the right things…
Do hard re-starts periodically (not sure why it worked, it just did this morning…)
If you uninstall MySQL be aware that it leaves files behind, which will include your database (thank god) and the password files from previously installed versions…
Thanks for all your help and a great tutorial…
You might want to point the last link http://www.myserver.dev/pma/index.php
to that address rather than what it’s currently aimed at!
September 6, 2008 at 2:22 am
Hi Michael
It finally works…!
Having made the above changes, and restarted Windows XP, I can now navigate to http://www.myserver.dev/pma/index.php and see the PHPMyAdmin screen.
Many thanks for your invaluable help – I guess I now need to learn PHP. So I’ll see if there any tutorials on that on this site.
Yours
Stuart
September 6, 2008 at 1:15 am
Michael
One further thing, I noticed when looked in the MySQL command line monitor that the TCP port in use was 3308 (no doubt a typo of mine when installing MySQL..)
I then changed the line $cfg['Servers'][$i]['port'] = ’3306′; in config.inc.php to read ’3308′ instead.
Now when I navigate to
http://localhost/
http://myserver.dev/ or
http://www.myserver.dev/
I get the phpinfo() screen. Presumably this means that PHP can now communicate with MySQL (via port 3308), but is MySQL talking to Apache?
The plot thickens..!
Yours
Stuart
September 6, 2008 at 12:45 am
Hi Michael
Yes, the extension folder is defined in php.ini and also I have enabled the extensions mysql and mysqli in php.ini (as per the tutorial).
When I look at the MySQL command line monitor, I can see that it is up, but also there is nothing against ‘Current Database’ – should this be set to ‘Apache’ perhaps?
Finally – how should I uninstall PHPMyAdmin? I simply deleted all the filesand folders that are extracted from the zip file and have done so twice now – is this the correct course of action? It is not listed in Add/Remove Programs in Windows XP so there seems to no other way of doing this..
September 5, 2008 at 11:09 pm
Hey Arta,
Relax. First uninstall Apache,MySQL etc via Windows Add/Remove Programs. Delete the extracted php folder as well.
Follow the tutorial properly, it`ll work fine. Be careful while modifying php ini files and editing httpd.conf files.
You`ll have no problem if you followed the tutorial step by step, trust me
Regards
September 5, 2008 at 9:51 pm
DEAr micheal
before i changed the php.ini.recommended the file name was php the type was php.ini.recommended should ichange the type or name
September 5, 2008 at 9:46 pm
i have checked everything but nothing is changed how can i entirely remove php then configure it again because when i tried to remove it it says it is in use but nothing in use in that time ooooooooooooooooooooooo
confuuuused please help me i need it badly
September 5, 2008 at 9:13 pm
hi and there is another thing i dont know if it is related when i wanted to chang php.ini.recommended to php.ini
another file is created that is configuration file and also that php.ini.recommended is existed but i have another one which is php.ini and it is called configuration file
September 5, 2008 at 9:09 pm
Hello Arta,
I feel you haven`t configured php.ini properly. Please follow the tutorial in making php recognize of mysql’s presence.
Check whether the extension folder is defined in php.ini ?
Check whether you have enabled the extensions mysql and mysqli in php.ini ?
Please see whether your mysql service is on. You can check by opening mysql via the command line client (Start->Programs->MySQL->mysql command line client)
Enter the password. Type \s when you see the mysql> prompt, to see teh status of mysql i.e whether it is running or not.
Also please enable port 3306 on your firewall or just disable any antivirus or firewall available.
Regards
September 5, 2008 at 8:18 pm
sorryyyyyyyyy
i didi some changes and not it gives me 404 error(page not found)
September 5, 2008 at 7:53 pm
this is the error it gives me after doing a testmysql.php
Fatal error: Call to undefined function mysql_connect() in C:\server\www\myserver.dev\public_html\testmysql.php on line