Professional Documents
Culture Documents
2 in Windows 7/Vista/XP
This tutorial is a textual version complementing Screencast #1 : Installing Apache 2.2, PHP 5.3, MySQL 5.1 & PHPMyAdmin 3.2 for Windows 7/Vista The Tutorial is the modified version found at Vision Master Designs.
Index :
Step 1 : Install Apache Step 2 : Install & Configure PHP 5.3 Step 3 : Configure Apache 2.2.11 Step 4 : Testing our Apache + PHP Step 5 : Installing and Configuring MySQL5 Step 6 : Installing and Configuring PhpMyAdmin 3 Optional Step 7 : Making Windows recognize myserver.dev Optional
The Pre-Requisites :
1. 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. Download Apache 2.2.11 (with no mod ssl) (1325) 2. PHP 5.3 Download PHP 5.3.0 (VC6 Thread safe) (1558) 3. MySQL 5.1.36 Goto Download page 4. PHPMyAdmin 3.2.0.1 PHPMyAdmin Download Page | Direct Download PHPMyAdmin 3.2.0.1 (614)
The above downloads are compatible with Windows 7/Vista/Vista SP1 (32 bit OS). Before starting this tutorial. Please Turn off UAC (User Access Control) in Vista. Trust me you will get fed up on how many times it`ll popup while installing this environment.
Now to install PHP5. Open the zip file & Extract all your files to C:\server\php. Navigate to C:\server\php
2. Rename php.ini- file
Open up php.ini using any text-editor. (Notepad, Wordpad, Preferrably Dreamweaver). There are 2 edits in this file.
3. Edit 1
Find extension_dir = "./" and replace it with (Please note the slashes)
extension_dir = "C:/server/php/ext"
Edit 2
Now in the following edit, you just have to uncomment (by removing the ; semicolon) from the extension to activate it. So here are the extensions to be uncommented. Search for each one them and remove the semicolon ;
;extension=php_gd2.dll ;extension=php_mbstring.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll
The First extension enables the Image GD library of PHP. The Second enables mbstring. The Third and forth enables us to use MySQL database.
Great ! Now we have to add tell the computer to start php everytime the computer reboots. So, Navigate to your Start; Control Panel; System; Advanced System Settings then go to the advanced tab, Click on the Environmental Variables button, then scroll down in system variables to find PATH, Edit it Add the following Code to it, as shown below in the image, C:\server\php;
Some users had reported that they weren`t able to edit httpd.conf in VISTA using Notepad. Try using Dreamweaver or any other editor to edit the *.conf files. If you are still not able to open httpd.conf file in any text editor, you can try the following solutions
1. 2. 3. 4. Try different text editor Stop Apache server from the taskbar and then try to edit You should have administrative previliges. Try disabling UAC If none of the above work. Reboot your computer in safe mode and then try to edit httpd.conf
Okay, brace yourself, we got 5 Edits in this file. No big deal, pretty simple search and replace text.
Edit 1
Search for
#LoadModule rewrite_module modules/mod_rewrite.so
Replace with
LoadModule rewrite_module modules/mod_rewrite.so
Edit 2
Edit 3
Search
AddType application/x-gzip .gz .tgz
Edit 4
Search for
DirectoryIndex index.html
Replace with
DirectoryIndex index.html index.php
Edit 5
Search for
#Include conf/extra/httpd-vhosts.conf
Replace with
Include conf/extra/httpd-vhosts.conf
2. Now navigate to C:\server\Apache\conf\extra Edit httpd-vhosts.conf 3. Replace all the text inside with view sourceprint?
<virtualhost *:80> DocumentRoot "C:/Server/www/myserver.dev/public_html" ServerName myserver.dev ServerAlias www.myserver.dev <directory "C:/Server/www/myserver.dev/public_html"> AllowOverride All Options Indexes FollowSymLinks Order allow,deny Allow from all </directory> </virtualhost>
If you have followed perfectly you`ll see that Apache has restarted perfectly.
Follow this structure 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.
2. Create index.php
Open up notepad, type in the following code and save the file as index.php inside C\:server\www\myserver.dev\public_html\ as shown in the above picture.
view sourceprint?
<?php //index.php phpinfo(); ?>
Please note the file name, it is index.php. Many a times, Notepad saves it as index.php.txt, while saving, don`t forget to mention the type as All Files, this way Notepad will save it as index.php.
4. Install SQL, Now time to configure SQL. Its pretty simple, if you follow the onscreen instructions.
Detailed Configuration
InnoDB
DSS
Execute
6. Finally click on Execute and let mysql configure everything.
During the MySQL installation and configuration,if you have missed any step or have not configured properly, then you can run the MySQL Server Instance Config Wizard which can be accessed via Start->All Programs->MySQL. *If MySQL Instance Wizard does not complete the final step, reboot your computer and configure again.*
Now to test whether MYSQL & PHP along with APACHE are working fine, restart the webserver, i.e click on the apache icon in your taskbar (near time in the taskbar/startbar) and restart the webservice. After it has restarted (green play icon will be displayed), point your favourite web browser to http://localhost.
PHP 5.3.0....nice If you are able to see the above page, then you have successfully configured Apache+PHP5. To verify whether MySQL5 has been installed, scroll down the page until you come across mysql & mysqli heading as shown below.
This is an optional ! You can use your webserver without it as well. Extract all the files inside the phpMyAdmin-3.2.0.1-all-languages.zip to a C:\phpmyadmin. Now navigate inside C:\phpmyadmin you`ll see another folder named phpMyAdmin-3.2.0.1-all-languages (even if the name is something else), rename this folder to pma. Cut this renamed pma folder and paste it inside
C:\server\www\myserver.dev\public_html
2. Now If you have followed everything properly, when you point your web browser to http://www.myserver.dev/pma/index.php you will see a login screen or the following screen. If you get the login screen, the username | password is root | root.
Navigate to C:\Windows\System32\drivers\etc Open up hosts in notepad/wordpad/dreamweaver any text editor and add the following
view sourceprint?
1.127.0.0.1 1.127.0.0.1 myserver.dev www.myserver.dev
Conclusion
Thank you for reading this tutorial, hope you guys enjoyed There is a screencast based on this tutorial, so do check it out Screencast #1 : Installing Apache 2.2, PHP 5.3, MySQL 5.1 & PHPMyAdmin 3.2 for Windows 7/Vista