MindRivet

Rivetting your Day!

Configure Apache, PHP, Mysql

March 25th, 2008 by admin

Hosting your website - Part1 

The first step towards  is to go hands on, on your home PC. You may directly start working on a website on  a hosting account with the web host you register with (this will be covered in details in the next steps).But I would suggest you first get a feel of it on your personal computer.

The first step : Install Apache, php and my sql -

Installing Apache

1. Download Apache : http://www.apache.org/

2. Download the Microsoft Installer ( .msi ) package. Double click on the icon to run the installation wizard and Click next until you see the Server Information window. For the Network Domain and Server Name, enter localhost.
To start Apache everytime that Windows starts install it as a service.
Choose Typical installation.

3. To see if your Apache installation was successful open up you browser and type “http://localhost/” in the address bar. If Apache is successfully installed, you will se the words ‘It Works’ in your browser.

4. By default Apache’s document root is set to htdocs directory.

If you installed Apache in C:\Program Files\Apache Group, the configuration file for Apache will be stored in C:\Program Files\Apache Group\Apache2\conf\httpd.conf. Edit it using any text editor like notepad.

For example, to change the document root find this line in the httpd.conf :

DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs”

and change the folder path to where you want the php and html files to be pulled from.


1. Download MySQL : http://dev.mysql.com/downloads/

2. Download the msi package for mysql. Double click to start the installation.

3. Choose setup type “Typical”.

4. In the MySQL.com Sign-Up page, ensure “Skip Sign-Up” is selected.

5. In the Wizard Completed page, ensure “Configure the MySQL Server now” is checked

6.The MySQL Server Instance Configuration Wizard appears with Welcome to the MySQL Server Instance Configuration Wizard 1.0.

7.  Select standrad configuration.

8. Choose to install as a windows service.

9. In the Security Options page, enter and Confirm (retype) your password

10. Click execute in the next page and wait while the Server Instance Configuration Wizard configures MySQL

11. Open a DOS window and type C:\mysql\bin\mysql to see the MySQL client running if your installation is successful.

12. To test the installation, start the MySQL Command Line Client from the installed Program and enter the password you specified during installation, when prompted. The client will connect to the mysql server and you will get a welcome message and the mysql prompt.

 Install and configure PHP

1. Download PHP : http://www.php.net/

2. First, extract the PHP package ( php-5.2.5-Win32 zip ) to a folder say C:\PHP.

3. Choose MyComputer, Select properties, select the Advanced tab, click Environment Variables, in the System Variables, select Path and edit it to add C:\PHP. In the System Properties .


4. now -

  • In C:\php, copy the file php.ini-recommended and rename the Copy of php.ini-recommended to php.ini
  • Edit php.ini using a text editor
  • In php.ini, find this line:
    display_errors = Off

    and enable the display of errors by changing the value to “On”:

    display_errors = On
  • In php.ini, find this line:
    extension_dir = "./"

    and specify the directory in which the loadable extensions (modules) reside by changing the value to “ext”:

    extension_dir = "ext"
  • In php.ini, find these lines:
    ;extension=php_mysql.dll
      ;extension=php_mysqli.dll

         and enable both the MySQL and MySQLi extensions by uncommenting the lines:

     extension=php_mysql.dll
     extension=php_mysqli.dll 
     Note: In php.ini a comment is started using a semicolon (;).
  • Copy the following dll files to C:\WINDOWS\system32:

       C:\php\libmysql.dll

       C:\php\ext\php_mysql.dll

       C:\php\ext\php_mysqli.dll

  • Go to Start > Programs > Apache HTTP Server 2.2.4 > Configure Apache Server > Edit the Apache httpd.conf Configuration File
  • Add the following three lines at the end of the file:
    LoadModule php5_module "C:/php/php5apache2_2.dll"
      AddType application/x-httpd-php .php
      PHPIniDir "C:/php"
  • In httpd.conf, find this directive:
    <IfModule dir_module>
      DirectoryIndex index.html
     </IfModule>

     Add index.php as a directory index:

    <IfModule dir_module>
     DirectoryIndex index.php index.html
    </IfModule>
  •  Restart Apache as you modified httpd.conf file.
  •  To test create a a test.php file and put it in document root directory.
    Content of test.php:

<?php
phpinfo();
?>

This entry was posted on Tuesday, March 25th, 2008 at 9:38 pm and is filed under Make Money Online. You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

Bookmark and Share

4 responses about “Configure Apache, PHP, Mysql”

  1. WordPress Tips said:

    […] MindRivet Rivetting your Day! « Configure Apache, PHP, Mysql […]

  2. Register Domain Name said:

    […] out on Hosting your website - Part1  and Hosting your website - Part2 for steps you may want to take care of prior to domain name […]

  3. Make Your Own Web Site » Make Your Own Web Site said:

    Make Your Own Web Site » Make Your Own Web Site…

    Free dating script working on PHP and MySQL. Multilanguage, Multitemplate, 35 registration fields, 3 photos, quick/ simple search, feedback with webmaster, Admin maillist, Photo of the day, who is online, statistics, and more……

  4. Web Hosting Account | MindRivet said:

    […] I ensure that my hosting account supports php and mysql so that I may use Wordpress. For Tips on Wordpress check out on Hosting your website Part2. For setting up you personal web hosting server check out on Hosting your website Part1. […]