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 31, 2008 at 11:14 pm
i m using php5 as per your instructions in this tutorial.
**i m trying to fetch “top tags” of url. the code is
<?php
[code]
$url = "http://www.worldatlas.com/";
$urlHash = md5($url);
$rawoutput = "http://badges.del.icio.us/feeds/json/url/blogbadge/?hash=$urlHash";
//echo $rawoutput ."";
$output = json_decode($rawoutput);
echo $output[0]['top_tags'];
[/code]
?>
October 31, 2008 at 10:43 pm
hi,
ok. basically i am getting url from user as an input in a text box.
2. then on pressing a button called ‘get posts’ (in front of text box) will call a php file containing will show the ‘top tags i.e. 10 tags’ of a provided url on the page.
3. thats means i am only trying to get “top tags” of same url from delicious website that people already used it.
October 31, 2008 at 9:59 pm
Hey Sead,
Thats odd, php.ini file does contain the given extensions, I assume you have followed the instructions correctly.
if you are not able to find using Find & Replace in Notepad, try doing a manual search. The extensions are definately there.
Regards
October 31, 2008 at 9:57 pm
Hey Ather,
I completely haven`t understood your question, but it seems you are tryin to fetch something from delicious based on a URL. Are you trying this on php4 or php5 ??
Is it a plugin for wordpress or just a standalone file ?
Regards
October 31, 2008 at 9:53 pm
Hey Pedro G,
please note there was an error on the previous entry. Please also see to it that the location where you have put your files exist.
[code]
DocumentRoot "C:/Server/www/myserver.dev/public_html"
ServerName myserver.dev
ServerAlias myserver.dev
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
[/code]
If the above is not working, try to create the same structure in an other drive (for example d:) and edit the path in the above code. Please note the forward slashes.
Normally this happens if your directory has not been found or is not writable. This is a very common error, although your scripting files must be easily accessible.
I`ll try to find a solution to it.
Regards
October 31, 2008 at 9:41 pm
hi sorry this is actual code. sorry about making mess in last post.
['total_posts'];
?>
October 31, 2008 at 9:38 pm
<?php == php opening bracket
-> == pointer. i.e. dash and greater than sign.
->
October 31, 2008 at 9:35 pm
hey Micheal,
i know its not the right place to ask but i believe you know this and can answer.
[code]
<?php
$url = "http://www.php.net/";
$urlHash = md5($url);
//echo $url.$urlHash."";
$myoutput = "http://badges.del.icio.us/feeds/json/url?hash=$urlHash";
$output = json_decode($myoutput);
//echo $output."";
echo $output->['total_posts'];
[/code]
what i am trying to do is, to get ‘total posts’ of a url from delicious site using their feed/API’s.but its not showing any result.
any idea whats wrong.
thanks.
October 31, 2008 at 4:20 pm
Hey
I just installed mysql and did all needed configurations before and when I want to go to http://www.myserver.dev I’m getting message forbidden you have no rights and so on.
I must say I couldn’t find extension=php_mysql.dll
extension=php_mysqli.dll
Help plz
October 31, 2008 at 2:35 pm
Michael,
In addition, I am able to ping succesfully
October 31, 2008 at 11:44 am
Michael,
I copied exactly like you posted. I do not understand why whe I post to you a copy
it does not look exactly how you posted in comment 240.
But, trust me I did exactly what you have
October 31, 2008 at 11:41 am
Michael,
I did with C: and D: and nothing
Below is what you find in httpd-vhosts.conf
DocumentRoot “C:/Server/www/myserver.dev/public_html”
ServerName myserver.dev
ServerAlias http://www.myserver.dev
Options Indexes FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
October 31, 2008 at 10:19 am
Hey Pedro G,
Replace all the code inside httpd-vhosts.conf with the above. Reboot your computer and lemme know
Regards
October 31, 2008 at 10:15 am
hi Micheal,
Thanks for your quick reply.
Do you how to use json_encode() and json_decode in php4. I am having old version php4 with AbriaMerlin installation kit which is very easy to install. No configuration required. nothing at all.
could you plz tell me how should i use JSON.php file to make it working with php4. plz i have to submit my course work in next week.:-)
Thanks a lot for your reply. tc
October 31, 2008 at 9:53 am
Hey Jenn,
please use [sourcecode] [code][/code] [/sourcecode] tags to put your code in.
October 31, 2008 at 9:51 am
Hey Ather,
Glad that you got it working.
If you want to shift all to D:, then edit the httpd-vhosts.conf change the Document Root, to which ever location you want. Please note the forward slashes.
Regards
October 31, 2008 at 2:40 am
Michael
Please help!!!
I know I installed PHP and Apache correctly. The only problem is the HTTP 403 Forbidden.
Below is my httpd-vhosts.conf llooks like:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn’t need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option ‘-S’ to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#
DocumentRoot “C:/server/www/myserver.dev/public_html”
ServerName myserver.dev
ServerAlias http://www.myserver.dev
ServerAlias localhost
AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
#
# ServerAdmin webmaster@dummy-host.localhost
# DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost”
# ServerName dummy-host.localhost
# ServerAlias http://www.dummy-host.localhost
# ErrorLog “logs/dummy-host.localhost-error.log”
# CustomLog “logs/dummy-host.localhost-access.log” common
#
#
# ServerAdmin webmaster@dummy-host2.localhost
# DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost”
# ServerName dummy-host2.localhost
# ErrorLog “logs/dummy-host2.localhost-error.log”
# CustomLog “logs/dummy-host2.localhost-access.log” common
#
October 31, 2008 at 12:07 am
Sorry, my last post was cut off:
…and this is my config.inc.php file:
October 31, 2008 at 12:05 am
Michael- your tutorials really helped when installing Apache, SQL and PHP, so I’d like to thank you for that (I’ve been messing with these for days and they just don’t seem to want to work with Vista!)
However, like many on here, I’m having trouble with phpMyAdmin- only my issue results in not being able to log in. I navigate to http://localhost/pma and it brings up the log-in window just fine; I type ‘root’ for the username and ‘root’ for the password (without the quotes, of course). When I hit ‘Go’, it acts like it’s going to load another page, but then just refreshes the login page, and I’m sitting there, being asked for my username and password again.
I’ve done a sample MySQL connect test… that ran perfect fine, I was able to connect to to the database using ‘root’ and ‘root’. When I go to my info.php page, that comes up just fine as well, I can see my mysql/mysqli settings; my only problem seems to be with looging into phpMyAdmin. Any idea why this is happening?
Just in case you want them, here’s some snippets of code: this is what’s in my mysql.php file, which allows me to connect, problem free:
<?php
mysql_connect(“localhost”, “root”, “root”) or die(mysql_error());
echo “Connected to MySQL”;
?>
…and this is my config.inc.php file:
October 30, 2008 at 3:11 pm
Well, another failed tutorial. It doesn’t work. Got the same error as Derrick.
October 30, 2008 at 7:18 am
Hey Champ!
sorry man, that was my fault. i delete everything and reinstalled from beginning its working.
I was doing one little mistake which was “i was giving MySQL current password as ‘root’ as well. however it doesnt require anything in that field. surprise.!”. i dont knw i was getting three boxes for password.
Long story short. its perfectly working now for me. million thank.
Another question?? for you.
a. like other guys i also want to keep my files in D: drive instead of C.
>> ‘C:\server\www\myserver.dev\public_html\’
This is where you will be putting all your html,script etc files to be accessed by your webserver.
how should i set my path so that apache get my files from that path and show accordingly on browser. e.g D:\php\www\ —–> i want this as localhost and then project folder having all files under this folder.
Early reply requested cheers.
October 30, 2008 at 5:16 am
sorry dont be confuse with AbriaSoft package. i have uninstalled everything and following these steps from scratch.# thanks in advance.
October 30, 2008 at 5:14 am
Hi,Micheal,#
I was running Abriasoft to install everything WAMP for my machine. but due to my project requirement i need to have php5.
so i followd ur suggestions and upto step 5 evryting works brilliiant. but…
when i EXECUTE for mySQL, it stuck on last option for security.
As per your suggestion tried to ‘disable’ norton/firewall and windows firewall. its still says,
connection error… ‘The security settings could not be applied to the database because the connection has failed with the following error. Error Nr. 1045 Access denied for user ‘root’@’localhost’ (using password: YES)
please help!!!!!!!!
October 29, 2008 at 8:38 pm
Michael
I did as you asked. Plus I went back over the tutorial to see if I might have missed something. I restarted the machine and apache and I still get the DNS error.
October 29, 2008 at 3:46 am
Anybody know where can i find a script like this?
http://www.swoopo.co.uk/ … and how much can cost?
Thank You!
October 29, 2008 at 12:27 am
Hey MichaelJ,
I am kinda clueless right now, although do one thing, make a back up of your hosts file and create a host file without the other hosts.
Now try running apache with the new host file,
If apache works then definately the problem is with your hosts file
else there is some other problem.
I`ll do a research on that. Forgive me for the delay
Regards
October 28, 2008 at 7:17 pm
Michael
The reason my hosts file is so long is that Spybot Search & Destroy has pasted a bunch of website in there that are believed to be malicious. So forgive me but I will put up with the larger file in order to protect my system.
So has I posted the lines you wanted are in my hosts file but I am still getting that DNS error. so what is the next thing to check?
October 28, 2008 at 10:03 am
Hello Vijay,
Firstly check properly which extensions have you enabled in the php.ini file. Are the correct extensions ?
Secondly, Restart your computer after you modify the php.ini file. Then point to http://www.myserver.dev
Regards
October 28, 2008 at 8:10 am
After installing and configuring mysql in my system, wen i point the browser to http://www.myserver.dev, the page opens as mentioned above letting me know tht all the installations were successful but I cudn’t see the mysql and mysqli headings in tht page? can anyone pls help me?
October 26, 2008 at 10:21 pm
if you have a lot of hosts inside your hosts file, then your hosts file is infected or corrupt.
ideally the host file shouldn`t contain much, this is what it is supposed to have
October 26, 2008 at 8:25 pm
Sorry, that is not the problem.
Here is what is in my hosts file (or a portion of it, it is way to long to post the whole thing here):
127.0.0.1 localhost
::1 localhost
127.0.0.1 myserver.dev
127.0.0.1 http://www.myserver.dev
and yes I am connected to the internet when I try this.
October 26, 2008 at 7:25 pm
Hey MichaelJ,
I think you haven`t edited hosts file inside windows folder.
You need to point 127.0.0.1 as myserver.dev to tell that this domain is a local domain & behaves just like localhost
Also your computer must be connected to some network (internet,lan) for myserver.dev to work.
Regards
October 26, 2008 at 12:21 am
Thank you for this tutorial.
I have gotten through step 4 but http://myserver.dev/
gives me this error
Network Error (dns_unresolved_hostname)
Your requested host “myserver.dev” could not be resolved by DNS.
For assistance, contact your network support team.
http://localhost/ works just fine.
I tried all kinds of ServerAlias terms in the vhosts but that doesn’t seem to have done any good.
October 25, 2008 at 7:46 am
I have an odd problem, I folowed this guide step by step(great work by the way), php, mysql and apache work great, the only problem I have is that when I acces http://www.myserver.dev, I get the It works! from the apache in htdocs/index.html, everything else works great, any idea?
October 25, 2008 at 3:23 am
Olala i found it…
the problem is not the php.ini file …
the problem is in the config.inc.php … i have deleted all the code and paste this:
and is working… whit the user root and pass also root … good job guys.
October 25, 2008 at 3:02 am
oki i did it and guess what? … the same problem
( should i reinstall the phpmyadmin?
October 24, 2008 at 9:58 am
hey Sprozzy, Gabriel
Thanks for posting in,
This is for all users who are having problems with phpmyadmin,
you need to load another extension called mcrypt
please open up php.ini and search for
remove the commenting character i.e. ;
reboot your pc and then try out phpmyadmin
Regards
October 24, 2008 at 6:27 am
I have a prob. when i click on http://www.myserver.dev/pma/index.php and put the user and the pass ( root bouth) it appears a blank page…. white whit an “#” up… why that? what’t wrong?
October 24, 2008 at 5:43 am
I have a lil prob.
In the end when i try to login in http://myserver.dev/pma/index.php whit root and root i see a white page whit an # up … verry cute where could be the problem anybody know?
October 23, 2008 at 10:43 pm
Hi Michael
Excelent tutorial – thankyou
When I run http://www.myserver.dev/pma/index.php I get a logon screen. Entering Username root and Password root opens up phpMyAdmin but at the bottom of the login box is “Cannot load mcrypt extension. Please check your PHP configuration. What do I need to do please
October 22, 2008 at 2:16 am
Hi Michael,
What a really fantastic tutorial! I was only stumped at one point when editing the config files and Vista complaining I couldn’t save the files. The fix is to turn of the UAC option on Vista. It defaults to not allowing the user to overwrite files on the C:/ (or the drive windows is on) You can get round this by changing the security permissions for that file to modify. You may want to include this info in your tutorial, but thanks again for a fantastic article!
Cheers
Michael
October 16, 2008 at 9:18 am
I am looking forward for your updates Mike.
thank you very much and God blessed.
Adrian
October 15, 2008 at 2:44 pm
Hi all this is a fantastic tutorial, I also had a few problems getting everthing to work but reading the posts helped. With the problems I just deleted everthing I installed and then went through it all again, you’ll learn more about what ur doing. What I would like to know now is what have I done exactly.
What I mean is we all installed Apache/MySQL/PHP but have we just created a virtual directory or what could someone ellaborate on the details.
Also I have everthing working except for the test.php script in the public folder it just gives a blank screen. Any suggestion.
I also have a number of different web sites that I have working and now would like to know where to put the files for all of them.
Previously I have placed them in the HTDOCS folder and used DW8 the edit them, do I continue in this folder or place them into the public_html folder.
Excellent tutorial just persevere and all will work guys
VoodooJai
October 14, 2008 at 1:56 am
Hi
I have one taught ,What about the foreward and back slash convention of file saving for the Two Windows and Apache,both uses differently.If that is the sheet How I can make vista understand the apache way of file saving.
TNX.
October 14, 2008 at 1:49 am
Hi
I have been Instaling and Configuring Apache 2.2.9 but I got the troble when I try to configure httpd.conf file Vista is saying you can not create this file.Please Help me.
Thank you In Advance
October 13, 2008 at 5:29 pm
Thanks for the comment Adrian.
This tutorial is about 3months old and I am currently working on a revision with the latest releases of the above packages and will be posting it very soon.
October 13, 2008 at 1:26 pm
Hey guys,
some of the info given by Mike was not really good. but I follow his comment by copying some of the codes. now I am Ok. try to see all his responds/comment and copy those codes there.
Regards/Kaya nyo yan,
Adrian
October 13, 2008 at 4:33 am
Thanks for the tutorial!
I was getting the 403 forbidden error, and after hours of trying to change files and figure out the problem, I just uninstalled everything and started over. Now it all works like a charm! I must have messed something up the first time.
Thanks again!
October 13, 2008 at 4:03 am
Derrick,
Here is a link to the Apache wiki regarding known bugs when installing on Windows Vista:
http://wiki.apache.org/httpd/WindowsVistaPlatform
Maybe this will help you with your problem.
You can install on Vista without turning any critical settings off. The only thing you need to turn off is the UAC. You can turn it back on after install if you feel this is a “critical” setting. I personally don’t have UAC on anytime. I find it annoying.
Now please stop saying it can’t be done or that doing so will result in OS failure. You can and it won’t. If you want to continue arguing that it’s impossible, please take your comments over to one of the many Apache forums.
October 13, 2008 at 1:08 am
Mike,
I know you’re wanting to help people, but there is NO WAY possible you got this work. telling people they can do this on vista is causing people to waste alot of time.
You can’t run apache on vista and you cant open php files in your browser. i tried to run apache and it said “the requested operation failed”. CAN’T BE DONE.
i followed you tutorial step by step. ]
If anyone even gets this to work on vista, you probably have some critical settings off. Eventually, you OS will lock up and you will be screwed unless you are backed up on an external.
Besides, you are missing too many steps here to mention – like running the msi command before installing apache.
Nice try mike, but its a no go.