eHow launches Android app: Get the best of eHow on the go.

About

MySQL PHP Apache Tutorial

Contributor
By Kristen Leigh Grubb
eHow Contributing Writer
(0 Ratings)

Combining the open source MySQL database, PHP scripting language and Apache Web Server allows you to create dynamic web sites for free. This software application is the basis for the popular LAMP (Linux, Apache, MySQL and PHP) and WAMP (Windows, Apache, MySQL and PHP) web development software stacks.

    Installation

  1. The Windows binaries for Apache and MySQL are available with the Microsoft Installer. The Installer will start the familiar installation wizard which will walk you through the set up process. The installation wizard for Apache will present a Server Information window where you will enter the Network Domain, Server Name and administrator's email address. Choose "Install Apache as a Service" if you want the Apache server to start up automatically when Windows is booted. When the installer is complete, type "http://localhost" in a browser window to check that the installation is complete. To install a typical MySQL server, just start the installer and click "Next" until the installer is finished.

    The PHP package comes as a .zip file. Extract into the directory where Apache is installed (C:\Program Files\Apache Group\Apache2). There will be a file called "php.ini-dis" in the newly extracted directory. Copy this file into C:\Windows, and rename the file to "php.ini." Then move the "php5ts.dll" file into the "sapi" subdirectory.

    Modify the "C:\Program Files\Apache Group\Apache2\conf\httpd.conf" file and add the following lines:

    LoadModule php4_module php/sapi/php4apache2.dll
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    Restart the Apache server by clicking on "Restart" under the "Apache Server" menu in the main "Programs" menu.

    Open a Command Prompt window (found under "Accessories" in the main "Programs" window) in order to start MySQL and install it as a service. At the command prompt, change to the MySQL directory by typing "cd C"\mysql\bin". Make sure that MySQL is not running by typing "mysqladmin -u root shutdown". Then type "mysqld-nt --install" to install the service. Start the service by typing "net start mysql". Start the MySQL client by typing "mysql".
  2. Configuration

  3. By default, the document root for Apache is the "C:\Program Files\Apache Group\Apache2\htdocs" directory. This is where you place the web pages (HTML or PHP files) so that Apache can process them. If you would prefer to place them somewhere else, you will have to edit the "C:\Program Files\Apache Group\Apache2\conf\httpd.conf" file and change the line that starts with "DocumentRoot" to reflect the new directory. The httpd.conf is the main configuration file for the web server. Every time you edit this file, you must restart the Apache service for the changes to take effect.

    The main configuration file for PHP is the "C:\Windows\php.ini" file. Like the "httpd.conf" file, the "php.ini" file is a well commented text file. You do not have to edit it in order to run PHP, but you should at least read down through it to make sure it suits your environment.

    Once these files are edited, you are ready to start creating your site. Remember to place your files in the document root that is specified in the "httpd.conf" file. You can test your new web site by typing "http://localhost" in a browser window.

References

Subscribe

Post a Comment

Post a Comment Post this comment to my Facebook Profile

Related Ads

Get Free Computers Newsletters

Copyright © 1999-2010 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

eHow Computers
eHow_eHow Technology and Electronics