Home arrow Apache arrow Page 5 - Installing and Configuring Apache 2 on a Windows XP Machine

Configuring MySql - Apache

Apache 2 represents quite a change from previous versions. If you have set up a previous version of Apache on a Windows XP PC, you will be interested in setting up the new version. Dan Wellman shows how to set up and configure Apache 2 on a Windows XP PC to give you a development environment that will allow you to test your PHP and other dynamic web technologies before taking them live.

  1. Installing and Configuring Apache 2 on a Windows XP Machine
  2. Getting Started
  3. Configuring
  4. Getting PHP Working
  5. Configuring MySql
By: Dan Wellman
Rating: starstarstarstarstar / 153
September 28, 2005

print this article



All that remains is to install and configure MySql.  This is probably the trickiest part and involves several steps for success.  First, download the MySql 4.1 installer for Windows from www.mysql.com and run it.  Accept all the defaults and use localhost for the server name.  A guest account will work, but will not be as secure as one with a password. 

Once MySql is installed, go to the System control panel applet, select the Advanced tab and click the Environment Variables button.  Highlight the Path variable and select the Edit button.  Go the very end of the line and add ;C:\php then click OK. 


You’ll need to restart the machine at this point.  Now go to the find files option in the start menu and do a search for libmysql.dll, then copy this file to your default PHP location (C:\php).  Now go back to the find files window, do a search for php.ini and open the file found in Notepad.  Scroll down until you find ;extension=php_mysql.dll and remove the semi-colon from the beginning of the line.  Save this file and restart Apache.  This should work fine, but if you get an error message saying that the libmysql.dll file could not be found, try copying this file to the Apache Bin folder as well.

To test MySql, open Notepad and type the following:


  $dbPass=' ';
  $link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die
("Could not connect");
  print "Connected successfully<br>";
  mysql_select_db("$dbName") or die("Could not select database");
  print "Database selected successfully<br>";



This will simply attempt to connect to the server and select the test database that is created during the MySql installation.  Save this file as mysql.php in your web site folder then open a browser and type http://localhost/mysql.php.  You should see a web page displaying:

Connected successfully
Database selected successfully

Your WAMP installation is now complete. You should now be all set to begin creating and testing complex database driven, dynamic web sites.  Please note that the set up described in this article is for closed, development environments only.  This configuration is in no way secure and should not be used for production.

>>> More Apache Articles          >>> More By Dan Wellman

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Apache Unveils Cassandra 1.2
- Apache on ARM Chips? Dell and Calxeda Help M...
- The Down Side of Open Source Software
- VMware Unveils Serengeti for Apache Hadoop
- SAP Takes Steps to Improve Hadoop Integration
- Looking to Hone Apache Hadoop Skills?
- How to Install Joomla on WAMPP
- Working with XAMPP and Wordpress
- GUI Available for Apache Camel
- Reduce Server Load for Apache and PHP Websit...
- Creating a VAMP (Vista, Apache, MySQL, PHP) ...
- Putting Apache in Jail
- Containing Intrusions in Apache
- Server Limits for Apache Security
- Setting Permissions in Apache

Developer Shed Affiliates


Dev Shed Tutorial Topics: