Jump to content

How to install and configurate Apache, PHP and MySQL on your own server.


Ruud Hermans

Recommended Posts

About: this tutorial only covers the basics of Apache, PHP and MySQL installation and configuration.Tutorial written by: Ruud HermansDate: 01-10-2006Operatins system: Windows XP (pro.)Apache Installation

  1. Go to the Apache website.
  2. On your left side now choose from "Apache projects" HTTP Server.
  3. Find the header "Apache 2.2.3 Released" and click on "Download" underneath it. (Windows 9.x users need to download Apache version 1.3)
  4. Find the header "Apache HTTP Server 2.2.3 is the best available version" and choose to download "Win32 Binary (MSI Installer): apache_2.2.3-win32-x86-no_ssl.msi".
  5. Now follow the installation wizzard.

For more information about Apache read the Apache user manual.To verify that Apache is working correctly after the installation visit http://localhost ore http://127.0.0.1 witch will direct you to the Apache welcome page.Apache File ConfigurationBy default the file storage path for Apache webserver is htdocs to change this do the following.

  1. Create the folder you wish your files to be stored in for example d:/webpages
  2. Go to the apache folder and open conf/httpd.conf.
  3. Change "DocumentRoot" from the default settings to "d:/webpages".
  4. Change "Directory" from the default setting to "d:/webpages".

Apache ConfigurationBy default your server will search for a file named index.html to display when visiting you server to make it search for index.php as well do the following.

  1. Go to the apache folder and open conf/httpd.conf.
  2. Search for "Directory Index".
  3. Add "index.php" behind "index.html.var".

To verify you made no errors in editing the configuration file visit http://localhost ore http://127.0.0.1, Apache should now display the files stored in the file you made it reffer to.After making changes to the Apache configuration file the Apache service needs to be restarted.PHP Installation

  1. Go to the PHP website.
  2. On top choose downloads.
  3. Find the header "Windows Binaries" and download "PHP 5.1.6 zip package".
  4. Create the folder C:/php and extract the files to there.

Configurate Apache For PHP

  1. Go to the apache folder and open conf/httpd.conf.
  2. Add to the end of the file the following lines:LoadModule php5_module C:/php/php5apache2.dllAddType application/x-httpd-php .php

Notest:Make sure "C:/php/php5apache2.dll" directs to the right path.Notest:beside the file "php5apache2.dhl" the file php5ts.dhl needs to be in the same folder. Configuration Control

  1. Open notepad.
  2. Create the file "test.php" with the following content.
    <?phpphpinfo();?>

  3. Save it in the folder you made Apache reffer to.
  4. Start you browser and open "http://localhost/test.php" ore "http:/127.0.0.1/test.php"

If PHP is installed the right way you should ow see you PHP Version info if not read back in this tutorial to find what you did wrong.MySQL Installation

  1. Go to the MySQL website.
  2. On your right side now choose "downloads".
  3. Find the header "MySQL Community Edition -- Database Server and Client" and choose "MySQL 5.0 -- Generally Available (GA) release for production use".
  4. Find the header "Windows downloads (platform notes)" and download "Windows (x86)".
  5. Now follow the installation wizzard.

You have now managed to install and configurate Apache, PHP and MySQL.Greetings,Ruud Hermans

Link to comment
Share on other sites

Few editions:1. The actual content you need to add to the httpd.conf for PHP is:

LoadModule php5_module "c:/php/php5apache2.dll"AddType application/x-httpd-php .phpPHPIniDir "C:/php"SetEnv PHPRC "C:/php"

Or you may also install PHP as a CGI binary:

ScriptAlias /php/ "c:/php/"Action application/x-httpd-php "/php/php-cgi.exe"AddType application/x-httpd-php .phpSetEnv PHPRC "C:/php"

2. Choose one of the two "php.ini-something" files and remove the "-something" part from it, so that the final file is called "php.ini".3. After installing MySQL from the wizzard and configuring it's instance right after, you need to open the php.ini file and edit the line:

extension_dir = "./"

(or whatever there's after the "=")to

extension_dir = "c:\PHP\ext"

And then remove the ";" from the line:

;extension=php_mysql.dll

You may also enable MySQLi support by adding the line:

extension=php_mysqli.dll

right after.If you need "graphical" assistance for the installation, I suggest the tutorial at http://www.tanguay.info/wamp/

Link to comment
Share on other sites

Thanks for the addings it's getting late and I wasn't paying attention enough I guess.Btw. for those to lazy to do this you can use XAMPP witch can be downloaded from Apachefriends the only problem with this is that it has some security issues but would do the job if you only needed it for testing your own scripts.Ruud Hermans

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...