DIY By Kalinga

 

How to Installing Apache 2.2 with PHP5.2 Support On Windows (2000/XP/2003)



 Home | Support Forum
 
I'm doing this installation on Windows XP/2003/2000, (may work on other versions of windows as well) with Apache 2.2.4 PHP 5.2.1 also make sure your not running IIS on your computer, if your not sure how to do this,
  • Go to Start --> Run --> type "CMD" and enter,
  • on the command line "type net stop http", say "Y" to each question.

Before you can do any installations, make sure to login to your computer as an Administrator.

 
 
Downloading
first download Apache & PHP5 to your computer

PHP5.2

Apache2.2

Installing Apache2.2
 

Run the apache_2.2.X-win32-x86-no_ssl.msi file

  1. On the Welcome Screen, Click Next
  2. On the License Agreement Page, Read the License Agreement, Select "I accept the terms in the license agreement", click Next
  3. Read the Read This First screen, and select Next.
  4. Now On the Server Information page
  5. On Network Domain, enter your domain (e.g. orbitsl.net) or if dont have a domain, enter "localhost"
  6. Server Name, enter somename.yourdomain (e.g. myserver.localhost or server.orbitsl.net)
  7. Administrators Email Address, enter your email.
  8. Select "for All Users, on Port 80, as a Service" (This will make Apache run on default port 80 and start automaticaly when you start your computer) then click Next

    You can Change the above setting at any given time

     

  9. On the Setup Type, select "Typical" and click Next.
  10. Destination Folder, Click Next
  11. Ready to Install The Program, Click Install.

Once the installation is finished, open your favorite browser, (e.g. Internet Explore, Firefox), type http://localhost

  • You should see some thing like "It works!" or some thing similar.
Configuring Apache2.2
 
  1. Go to Start --> Programs --> Apache HTTP Server 2.2.X --> Configure Apache Server --> Edit the Apache httpd.conf Configuration File (Then a File will be opened in Notepad)

     

    • First lets change the default document directory (Where you will put your HTML/PHP files.)

       

      • Find the Line "DocumentRoot" in httpd.conf change it to

        DocumentRoot "c:/wwwroot"

         

      • Find the Line "<Directory ~" & change it to

        <Directory "E:/wwwroot">

       

    • Lets Change the comment types to .php .htm
      • Find the Line "DirectoryIndex" & change it to

        DirectoryIndex index.html index.htm index.php

       

    • Now Save the File and Exit.
    • Create a directory call wwwroot at drive C: (C:\wwwroot)
    • Create a HTML file call index.html at c:\wwwroot\index.html
    • Go to Start --> Programs --> Apache HTTP Server 2.2.X --> Control Apache Server --> Restart
      • If you done every thing right, this should work with out any errors.
    • Open your favorite browser, (e.g. Internet Explore, Firefox), type http://localhost if you have done every thing right, you should see your HTML files you have created.
Installing & Configuration PHP5.2 for Apache2.2
 
  1. Go to Start --> Programs --> Apache HTTP Server 2.2.X --> Configure Apache Server --> Edit the Apache httpd.conf Configuration File (Then a Files will be opened in Notepad)
  2. Fine the "#LoadModule ssl_module modules/mod_ssl.so" line, after the line add the below given lines (as it is)

    ##### PHP5 ######

    LoadModule php5_module "c:/PHP/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "c:/PHP"

    ##### PHP5-END ######

     

  3. Save the Files and Close it.

  4. Create a directory call c:\php

  5. Now copy the files php5apache2_2.dll, php5ts.dll & php.ini-recommended from c:\php5\ directory to c:\php directory

  6. Rename the php.ini-recommended file to php.ini

  7. Create a file call phpinfo.php in c:\wwwroot, open the file with a PHP editor or with notepad/WordPad & add the following text

    <?php

    echo phpinfo();

    ?>

     

  8. Go to Start --> Programs --> Apache HTTP Server 2.2.X --> Control Apache Server --> Restart

    • If you done every thing right, this should work with out any errors.
  9. Open your browser, enter http://localhost/phpinfo.php, if you have done every thing right, you should see PHP Installation Information.

 
Other Related Links
 

Tuesday, February 13, 2007

Copyright t Kalinga Athulathmudali, This information is provided as it is with no guarantee what so ever, and follow them at your own risk.