Hey Jon,
There are many distributions of WAMP out there to get started easily, but I'd suggest spending a little time going through the process of installing
Apache,
PHP and
MySQL manually (I'm assuming you're using
Windows).
Basically you will need to set up your development platform first (Apache, PHP, MySQL) then get yourself some development tools that you're comfortable with (Notepad++, phpMyAdmin).
First off I'll explain how to download and install each component, then I'll move on to configuring each one so that they can talk to each other.
(This post got rather long, will split it into two, Development Environment and Development Tools)
Installing the Development Environment
Apache HTTPD Server
First off I'd head over to Apache and download the latest binary:
http://mirrors.dedipower.com/ftp.apa...x86-no_ssl.msi
Installing this is simply a matter of following the on-screen wizard, you will probably want to keep default settings at this stage.
PHP
You will then need to head over to PHP.net and get the latest version of php. You can either download this as a simple ZIP file or as a Windows Installer. I'd highly recommend that you get the ZIP file as it seems to be a more complete package, again, avoiding the easy route here will pay off in the long term.
http://www.php.net/get/php-5.2.5-Win.../from/a/mirror
Once it's downloaded you will have to unzip the entire directory somewhere, I'd suggest c:\php\ as this will make configuring Apache (which I'll explain in a minute) a bit simpler.
MySQL
Next off is your MySQL server. In this case I'd suggest using the installer as creating your own MySQL instance is perhaps a bit out of the scope of this post, let me know if you'd like to know how though and I'll put something together.
Nip over to the MySQL Server web site hosting and get yourself a copy of the MySQL Community Server (this is the free version)
http://dev.mysql.com/get/Downloads/M...ftp.mysql.com/
Just follow the on-screen instructions for this one, I'd suggest installing to c:\mysql\ as this will make stuff easier further on!
Configuring the Development Environment
Enviroment Variables
Before we start I'd suggest adding some directories to your Windows Path variable, this will help the components find each other, and help you use them at the command line later.
- Right click on My Computer and select Properties
- Click on the Advanced tab.
- Click on the Environment Variable button
- On the System Variables list find Path and double click it
- Now you will add the MySQL and PHP paths by adding the following to the end of the line (subsitute the installation paths you chose here)
Code:
;C:\php;C:\mysql\bin
PHP
Navigate to your PHP directory and you should find a file called php.ini.recommended, rename this to php.ini. This will now act as your main PHP configuration file. You can leave it as is for now, but feel free to open it up and have a play with the settings.
There are only really two things you'll need to change here to get up and running.
Make sure PHP can find all it's required extensions, find the line:
And update this so it reads:
Code:
extension_dir = C:/php/ext/
To load the MySQL extension find the line:
Code:
;extension=php_mysql.dll
And remove the semi-colon from the start so it reads:
Code:
extension=php_mysql.dll
Apache
Like PHP, Apache has a core configuration file, you will find this in the conf folder within your Apache installation directory. It's called httpd.conf.
There are many many setting here you can play with, but for now we only need to let Apache know that you will be wanting to use PHP, so scroll down to the bottom of httpd.conf and add these lines (making sure the paths are correct for your php installation).
Code:
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
One last thing you'll need to change in your httpd.conf is a line to let Apache know to use any file called index.php as a directory index (so it will load any file called index.php as default when you visit a directory through your browser)
Find the section below:
Code:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
And change it to:
Code:
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
MySQL
You shouldn't need to touch the configuration for this, but incase you do you should find a file in your c:\mysql\ dir called my.ini - again you can have a mess around with this later on.
And we're done ...
Ok, give your computer a reboot and cross your fingers. When you're back up and running you'll want to do a quick test to make sure everything's installed.
Navigate to your Apache installation folder and open up the htdocs directory. Create a new file in Notepad and call it index.php, place the following code in this file:
PHP Code:
<?php phpinfo(); ?>
Save the file and go to
http://127.0.0.1 in your browser. With any luck you'll see a page appear with all of your PHP configuration settings. Somewhere here you should find a section titled MySQL - if you don't, something's gone wrong!
If all went well you've now set up your Development Environment - the next step is to decide which development tools you'd like to use (coming in the next post).