Home arrow Apache arrow Page 5 - Creating a VAMP (Vista, Apache, MySQL, PHP) Setup

Configuring - Apache

With the abundance of communication between the browser and a server in these days of AJAX and JSON data interchange, there has never been a better time to get your own development web server set up so that you can test all those dynamic scripts you’re writing. This article will show you how to do it using some of the most popular software.

TABLE OF CONTENTS:
  1. Creating a VAMP (Vista, Apache, MySQL, PHP) Setup
  2. Installing and Configuring Apache
  3. PHP
  4. MySQL
  5. Configuring
By: Dan Wellman
Rating: starstarstarstarstar / 41
May 20, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Now we need to configure PHP to use MySQL. Reopen php.ini in your text editor and find the Dynamic Extensions section (line 628). There should be a list of the different extensions currently in the ext folder. Find the line that reads ;extension=php_mysql.dll and remove the semi-colon from the start of the line. Save the file and restart your computer.

The output of the phpinfo() file will tell us whether PHP can see MySQL; just open up phpinfo.html in your browser again (requesting it properly from the server) and use "find on this page" to search for MySQL. You should see something like this:

To really test it we can create a file that will attempt to read data from the table we created earlier. In a blank page in your text editor add the following code:

<?php


mysql_connect("localhost", "root", "yourMySQLpassword") or die(mysql_error());

mysql_select_db("test") or die(mysql_error());

$query = mysql_query("SELECT * FROM people") or die(mysql_error());


while($data = mysql_fetch_array( $query )) {

Print "<p>Name: ".$data['name'] ."<br>" ."Likes: ".$data['likes'] . " </p>";

}

 

?>


Save this as mysqltest.php in the apache site folder and request the file from the server. The results should be something like the following page:

If you see the page correctly then everything works together as it should and everything is done. You can now enjoy the benefits of having your very own development web server. You should note however that this basic installation has not covered any security or optimization configuring, so you should absolutely not use this guide as a method to set up a live, publicly accessible web server.



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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

APACHE ARTICLES

- 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: