Windows Apache MySql PHP Installation Guide
From PsychoWiki
Contents |
[edit] Downloading WAMP
Download apache_2.0.58-win32-x86-no_ssl.msi - http://httpd.apache.org/download.cgi NOT 2.2 Download PHP 5.1.4 zip package - http://www.php.net/downloads.php Download MyQSL5 Windows (x86) (With installer) http://dev.mysql.com/downloads/mysql/5.0.html
[edit] Set up our directories
I like to keep everything neat and clean and orderly so I've set up the following directorie scheme you can keep the defaults or change the directorie names just beware of that when you configure PHP and Apache.
- Base dir = C:\webserver
- PHP dir = C:\webserver\php
- Apache dir = C:\webserver\Apache2
- MySQL dir = C:\webserver\mysql
- Website/Content dirs = C:\webserver\www
[edit] Installing Apache
(Windows 98/Me users may need to install previously the MS Windows Installer) Double click the msi file to launch the Apach Installation Wizard after accepting the license, you'll be prompted for some information: Network domain, Server name and Administrator's email you can enter whatever you want but if you don't know what your doing I would suggest entering localhost for both Network domain and Server name.
[edit] Common errors skip if you don't get any errors
1. If you get one of the below errors port 80 is already in use and only one application at a time can listen on a port, you may have IIS running if you do either install apache on another port (i.e. 8080) or disable/uninstall IIS when you need to run Apache or maybe change the port number IIS uses.
Error1: <OS 10048>Only one usage of each socket address <protocol/network address/port> is normally permitted. : make_sock: could not bind address 0.0.0.0.:80 no listening sockets available, shutting down Unable to open logs Note the errors or messages above, and press <ESC> key to ext. ...
Error2: [Sat Oct 09 14;22:48 2004] [error] <OS2>The system cannot find the specific ed. : no installed service named "Apache2". Note the errors or messages above, and press <ESC> key to exit
2. Your firewall may detect and block Apache in this case I would set:
* Inbound permissions - Only allow local network/trusted zones to have inbound access if this is going to be a test server. * Outbound Permissions - Give Apache outbound permissions incase you ever request a file on an outside server i.e and XML file.
If all goes well, the Apache service will be started and you'll notice a new icon in your system tray, the Apache Service Monitor. This is a handy tool for managing the Apache service: you can start, stop and restart the service from here.
Now lets test Apache to make sure that it installed properly, open a webrowser and go to http://localhost if your not connected to the net you may have to go to http://127.0.0.1 you should get the apache test page or a page that says "It works".
[edit] Configuring Apache
DocumentRoot "C:/webserver/www"
<Directory "C:/webserver/www">
DirectoryIndex index.html index.php index.html.var
[edit] Restart Apache using the Apache Monitor
Again test and make sure that apache goes to C:\webserver\www now you may get a 403 Forbidden error if you do put a file in C:\webserver\www and see if you can get that file if you can then your good.
[edit] Installing PHP
Unzip the contents of the php zip file and place them in C:\webserver\php.
[edit] Configure PHP
To make Apache use PHP copy these lines in the the http.conf file.
[edit] Make Apache Use PHP - File: http.conf
LoadModule php5_module "C:\webserver\php\php5apache2.dll" AddType application/x-httpd-php .php
[edit] configure the path to php.ini
PHPIniDir "C:\webserver\php\php.ini"
<Files *.php> SetOutputFilter PHP SetInputFilter PHP LimitRequestBody 9524288 </Files>
[edit] Make Apache Use PHP - File: http.conf
Restart Apache.
Rename C:\webserver\php\php.ini-recommended to C:\webserver\php\php.ini
[edit] Configure PHP - File: php.ini
extension_dir = "C:\webserver\php\ext\" extension=php_mysql.dll extension=php_gd2.dll short_open_tag = On
[edit] Configure PHP - File: php.ini
create a file called phpinfo.php in C:\webserver\www
in phpinfo.php type:
<?php
phpinfo();
?>
then go to: http://localhost/phpinfo.php
You should see all your php configuration neatly spilled out over the page.
[edit] Installing MySql
Installing MySql5 is quite trivial, install it into C:\webserver\mysql and accept the rest of the default options.
That should do it, check everything out and happy programming.