Trust Kroll Ontrack to recover your data


Installing the Apache Server and PHP 5 on a Windows Vista based Computer

Download the Required Files

This tutorial is about setting up a Development Server on a Vista based computer for checking php based web designs. But all the suggestions for installing Apache are still relevant if you want to install a full copy of the server technology for hosting a website.

To start you should download the latest version of the Apache Server. The correct download package for Windows is the one labeled Win 32 Binary (MSI Installer).

Rename the downloaded folder to just apache.msi.

While you are online also download the latest edition of the PHP scripting language. The correct download will be listed under Windows Binaries (currently PHP 5.6.7).

Change the name of this downloaded folder (ours was php-5.2.6-Win32(2).zip) to just php and extract the files.

Tip: its best to transfer these programs from the Vista Downloads Folder onto your Desktop before you start the installation process.

Installing Apache

If you have tried to install Apache already and have failed to get it working uninstall this previous installation and delete any left over folders in the Programs folder. The uninstall feature in Vista is found via Start - Control Panel - Programs - Programs and Features. This shows you a list of the programs installed plus the option to Uninstall/Change them.

If not already done, move the apache.msi and php folders from your Vista Downloads folder onto your Desktop for ease of access later on.

Now go to Start - Control Panel - User Accounts. Click on Turn User Account Control on or off and uncheck Use User Account Control (UAC) to help protect your computer. Now click OK and restart Windows Vista.

Before you install Apache turn off your internet connection and shut down all the programs in your system tray. Turn off any firewall and shut down any programs that are using port 80 (for example Microsoft's SQL Server which ships as part of MS Office for Small Business).

Once your PC starts up go to Start - All Programs - Accessories, right click Command Prompt and choose Run as Administrator.

Once the Command Prompt opens change to your Windows Desktop. To do this, at the prompt, type cd desktop and hit Enter.

Type the following command: msiexec /i apache.msi

This will open the Apache installer. Now proceed with the installation. Keep clicking next until you get to the Server Information panel. Under Network Domain enter 127.0.0.1. Under Server Name enter localhost. And enter your email address in the Administrators Email Address box. Do not leave any of these fields blank.

Now click the radio button Run as a service for all Users - Recommended. Click next.

At the Set Up Type page choose the option to install of all the program features (usually the top choice).

Now keep clicking next until you get to the Ready to Install page. Click the Install button.

When the installation is complete open up a browser and type http://localhost and you should get a message that its OK i.e. the default Apache information page.

Installing PHP

Before you start to install PHP make sure you stop the Apache server from running. Start - All Programs - Apache HTTP Sever 2.0 (or whatever you downloaded) - Control Apache Server - Stop.

If you also have a Microsoft's SQL Server or MySQL server running stop those as well. Right clicking their icons should give you the option to stop these servers from running.

Move the php file on your desktop to the route of your C: drive (C:/php). Also create two folders in the php file - uploads and sessions.

Now open the php folder and look for file called php.ini-dist (this file contains a default php configuration tailored for a development server). If you want to set up a full production web server to perhaps host a website use the php.ini-recommended file which has far greater security enabled to face the World Wide Internet.

Open php.ini-dist in Notepad and save a copy so you'll always be able to go to this if you need to start again from scratch. Place this in your Vista documents folder in a folder named phpfile (or any where else you might prefer to put the file).

Now save the file as php.ini and open it up in Notepad. You'll be faced with a lot of settings but only a few need amending.

Completing the PHP installation

In Notepad type CTRL-F and type in the search box doc_root and change this to "C:\webserver"

Now find extension _dir = "./" and change it to extension _dir = "C:\php\ext" (for PHP4 the extension folder is \extensions).

Next find upload_temp_dir = and change it to upload_temp_dir = "C:\php\temp\uploads"

Find session.save_path = /tmp and change it to session.save_path = C:\php\temp\sessions

Find ;extension=php_gd2.dll and remove the ;

Search for extension=php_mysql.dll and ensure there is no ; at the front.

Find extension=php_mbstring.dll and ensure there is no ; at the front.

That's the basic changes for the php.ini file so save it. Also save a copy of this file into your C:\Windows\ directory.

Find two files in your C:\php folder

libmysql.dll
php5ts.dll (php4ts.dll for PHP4)

Take a copy of both files and place them into your C:\Windows\system32\ directory.

Configuring PHP and Apache

Open C:\Program Files\ Apache Group\Apache 2\conf\httpd.conf (or open the httpd.conf file from where ever your copy of Apache is installed)

Search for DocumentRoot and change this to "C:/webserver"

Find #LoadModule and scroll to the end of the module list. Now add a new line LoadModule php5_module c:/php/php5apache.dll (for later versions try c:/php/php5apache2.dll or even c:/php/php5apache2_2.dll).

Now find AddType application/x-gzip.gz.tgz and add below it AddType application/x-httpd-php.php

Find DirectoryIndex index.html and add below it DirectoryIndex index.php

Now save the httpd.conf file.

Restart Apache and browse to the webserver folder you created earlier (C:\webserver). Place in their a file named phpinfo.php

This file should contain:

<head>
<title>PHP Test</title></head>
<body>
<?php
phpinfo();
?>
</body>
</html>

Browse to http:/localhost/phpinfo.php and if you see a web page showing Apache, PHP and MySQL information then you have successfully installed Apache and PHP onto your Vista based PC.

Installing the MySQL database

Download the latest version of MySQL and place it on your Desktop.

Just double click the .exe file and accept all the default options.

Once the download is complete reboot your computer.

Now browse again to http://localhost/phpinfo.php and see if the MySQL box is fully completed as well as the PHP and Apache boxes. If all looks OK you have successfully set up a Development Webserver on Windows Vista.

Read more articles about PC repairs, Web design & SEO...