tvorba www stránek
tvorba internetových obchodů
programování a vývoj internetových řešení
Kontaktní informace
+420 604 675 156

How to install Apache with PHP and MySQL on Windows XP

APACHE server logoInstalation of APACHE server with PHP5 support and working MySQL server is problem for lot of newbies. To find working "HOW TO" manual on internet is little bit problem too. Here is simple manual which will show you how to:

  • Install APACHE
  • Configure APACHE
  • Install PHP
  • Configure PHP
  • Install MySQL server
  • Configure MySQL server
  • Test if all is working

Download packages for install:

Install APACHE

  • Launch install program of APACHE 2.0
  • On screen Server Information into Network Domain section and Server Name section must be localhost
  • Admin email it's not important, but you can fill in your email
  • Select Typical instalation and multiclick to NEXT button to see Install button
  • To Install APACHE server on your computer, click to Install button.

Install PHP

  • Create directory C:devphp
  • Extract downloaded ZIP archive of PHP to C:devphp

PHP Configuration

  • We must add path to PHP engine to Windows PATH variable. Click to Start > Ovládací panely > System > Advanced > System variables - and add string C:devphp to PATH variable.
  • Copy file c:devphplibmysql.dll to c:WindowsSystem32 directory, then MySQL extension will working good. If you don't do this, PHP will not find extension php_mysql.dll a you will see message like Unable to load dynamic library / Module not found.
  • Copy file c:devphpphp.ini-recommended to c:Windowsphp.ini
  • Configure file c:windowsphp.ini:
error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR¨
display_errors = On
display_startup_errors = On
extension_dir = "c:/dev/php/ext"
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_mysql.dll
extension=php_tidy.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll

APACHE Configuration

  • In tray click to Apache monitor icon and select APACHE2 > Stop server. This will stop instance of server, because we need to configure httpd.conf file.
  • You can find APACHE configuration file on c:Program FilesApache GroupApache2conf . Edit file like this..

add lines:

LoadModule php5_module "c:/dev/php/php5apache2.dll"
AddType application/x-httpd-php .php

edit lines:

DocumentRoot "c:/dev/www"
#AddDefaultCharset ISO-8859-1
DirectoryIndex index.html index.html index.php
  • Create directory c:devwww . This directory will be root directory of your local web pages (localhost). To this directory you can copy your HTML and PHP files.

Test if all is working

Create file c:devwwwindex.php with this content:

<? phpinfo(); ?>

  • Click to Apache monitor in tray and select APACHE2 > Start
  • Launch web browser and type http://localhost. You will see long page of PHP configuration.

MySQL server install

  • Launch downloaded MySQL install program
  • Select Typical instalation
  • On screen MySQL.com Sign-UP select Skip Sign-up and click to NEXT
  • On screen Wizard Completed leave checked Configure the MySQL Server now a click to FINISH

MySQL server configuration

  • If your instalation of MySQL server is done, you see Instance Configuration Wizard, click to NEXT
  • On next screen select Standard Configuration a click to NEXT
  • On next screen must be checked all checkboxes.. Install As Windows Service, Launch the MySQL Server automatically and Include Bin Directory in Windows PATH
  • On next screen fill in two times password to your MySQL. This will be password for ROOT access to database. Check Root may only connect from localhost and click to NEXT button.
  • Now we will create instance of MySQL server - Click to EXECUTE a FINISH

And this is all. You have full working APACHE 2.x server with PHP 5.0.5 support and MySQL database server support! ENJOY!

Komentáře

[1] ee 11.04.2010 [20:16] <ee> www
Komentovat tento článek