Installing Apache, mySQL, PHP and phpMyAdmin
![]()
I tend to use php scripting in my websites alot more these days, which is a server-side HTML embedded scripting language (PHP is executed on the web server, so all the user see’s is the html the programmer wants them to see).
One of the main reasons I’ve started to use PHP is to create dynamic websites that can include database backend which could hold such data as product listings, making it an easier task to update larger sites.
you will need to download the following to build your free webserver:
Apache 2.2
mySQL
PHP5
phpMyAdmin
It is possible to use a command line based program to interface with the mySQL, but there are easier ways out there. phpMyAdmin is one of them.
The Fun bit is installing all this. I decided to go with a Server 2003 machine I already had setup. First was Apache, this wasn’t to bad, other than the listening port it wanted to use was already binded to another program so I had to go into the config file and change it, then it was working fine.
Second was mySQL, just as easy, go through the options clicking complete installation, then choose Apache 2.2 when it asks you, once installed it will ask you to put a password in, the default username is root.
Next on the list is PHP5, not quite as easy after an hour I found this the best way to install - agree to the license, then instead of using the destination folder “c:/program files/php” use “c:/php” (Apache didn’t seem to like the default one), then choose the Apache 2.2.x Module, the apache conf folder is where you installed it. Then I would leave the items to install as they are for the moment and install. Once that has completed, go back into the setup through the setup.exe or through add/remove on control panel, once in the item list again expand the “extensions” list and scroll down and install “mySQL” and “mySQLi” to get them working.
To Test that PHP is working, create a new file in htdocs (in your apache folder) called “phpinfo.php” and using notepad or wordpad type this in “” save it then go to it through http://localhost/phpinfo.php its quite obvious when it works.
Last of all is phpMyAdmin, for this one extract the contents of the zip file into htdocs/phpmyadmin/ and go to it through a browser (http://localhost/myphpadmin/index.php). If you set up the extention correctly when installing php you should be able to see a login screen. You should get an error if you try and login using the mySQL username and password, thats ok. Go to where you extracted the files in htdocs/ and find the file called config.sample.inc.php, rename it to config.inc.php then open it up in notepad again. and change the following values:-
$cfg['blowfish_secret'] = ‘ba17c1ec07d65003′; // use here a value of your choice
if you don’t want to be prompted for a password everytime:-
$cfg['Servers'][$i]['user'] = ‘root’;
$cfg['Servers'][$i]['password'] = ‘cbb74bc’; // use here your password
Go back to the phpMyAdmin login and you will either see admin pages (if you entered in your username and password) or will be able to log in using the root and your password.
phpMyAdmin is quite easy to use, but there is more documentation at phpMyadmin
and there we have it, and fully installed webserver with php and mySQL.
For resources on PHP there is more documentation at php.net

