Installing PHP, Apache, and mySQL on your 'lovely' windows.
Morten Samuelsen on 2001 March 31
    

Installing PHP, Apache, and mySQL on your Windows machine saves your dollars on your telephone bills

.

Before you do anything, first, you download the Win32 binaries.

Go to the list of sites to install programs:

The latest version of the Apache HTTP server (httpd.apache.org/dist/binaries/win32/)
And the latest version of mySQL (www.mySQL.com)
And of course the latest version of PHP (www.PHP.net)

If you use Windows 95, you need to install "Winsock 2" to run Apache 1.3.7 or later.
See information here: httpd.apache.org/docs/windows.html#req



Installing Apache

Installing is very easy: just follow the instructions tell you that in windows' popup when you click icons.

When the Apache installation is finished. Start apache up, go to your browser and type

http://localhost

If the installation is correct, your screen shows a page, telling you that you've installed Apache correctly.

If not, you get an error of some kind.

Read more online documentations, mainly the installation part, and check that you've started the server.



Installing PHP

PHP usually comes in Zip format.
Unzip it with Winzip www.winzip.com or some other unzip program to where you want it to be installed.

Now start configuring Apache to run with PHP.
Go into your Apache directory (by default it is C:apache) to find conf folder, and then open httpd.conf in your favorite text editor (I use Notepad).

Search for "ScriptAllias", and add following lines to your httpd.conf file.





       # This next line sets the path of PHP.
       ScriptAlias /php4/ "C:/Path/to/PHP/"
 
       # And now over to this one, this line sets the php.exe file.
       # If you see closely you see that "/php4/" refers to the alias you
       # added above.
       Action application/x-httpd-php4 "/php4/php.exe"
 
       # This adds the extensions that will bee passed trough the PHP application.
       Add Type application/x-httpd-php4 .php






Double check the path where php is installed and change it if you need.

Next, copy the file called php.ini-dist to your windows directory (i.e: C:WINNT on WinNT/2000). After you've copied it in there, rename it to php.ini.

The file php4ts.dll has to be moved to the windows' system(32) directory. You can safely overwrite any older files.

Ok, let's start Apache again, and test if you got PHP working.
Create a file named phpinfo.php in your document root, by default the htdocs directory in your main Apache directory.
Add the line to your new file:


<?php
 
    phpinfo
();

?>


Open your browser and type http://localhost/phpinfo.php, you will see if the installation is successful. You should now get a page full of useful information up.

If you don't get the page up, you messed it.




All right, you got Apache and PHP, now you want mySQL!

Usually the mySQL file is zipped, so you unzip it to a temporary directory.

Open the directory and start the installation.

The installation is quite easy, just wait until it finishes.

Start mySQL (By going to the bin directory in the main mySQL directory) and start mySQLd.exe.
Open a command prompt window, cd into the bin directory.

And type



      mySQLadmin -u root password yourpassword



Where yourpassword is the password you'll use from now on.

That may seem quite easy, but I didn't get it working at the first time.

Installation is finished, now check that you installed and configured mySQL correct. Type this:



       mySQL -u root -p



You will be asked for the password in case you've done everything correctly, but if not, well, there could be a lot of problems.

-M. Samuelsen
Tentatively planning to Open Soon! (no dates ...) // Doing heavy development now...