Contact Us

Apache Php Mysql

A tutorial about installation of apache php mysql with integration

AddThis Social Bookmark Button          AddThis Feed Button
Print   Email

1.  Apache Installation

2.  Php Installation

3.  MySql Installation

4.  Php configuration

5.  Apache Configuration

6.  Apache Services restart


Apache Installation


Apache is also known as httpd web server. This is open source project. Interesting thing, apache is most easily configurable web server. You can install apache on windows as well as on linux. If you want to install apache on windows, it would be easy task for you, instead of installing apache at linux.Apache is available in source code and binary form from apache’s website. Most of the time people use binary form for installation. We use binary form for apache installation.
Download apache from  for windows apache_2.0.55-win32-x86-no_ssl.msi download this file. Or for linux download tar or RPM file. Lets start installation work of apache, go for these links


apache installation on windows


apache installation on linux

After installing apache, next step will be to install php.This is shown in our next process

Php Installation

Php is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP something like client-side JavaScript is that the code is executed on the server. PHP know for LAMP Linux, Apache, MySQL and PHP 

Php can be downloaded from php site. First you need to download php php according to required operating system. If you want to install on windows, than you need to download Windows Binaries

PHP 5.2.3 zip package file otherwise go for tar file for linux PHP 5.2.3 (tar.gz). Before php download take a look on php download doc


Php Documentation HOWTO

Unzip windows php with any file extractor. In linux,
Untar by linux command on terminal

#tar –xvf php-5.2.3.tar.gz

Keep folder at you favorite location. E.g “c:\php”
or /php


MySql Installation

Mysql is open source database. It is very powerful database in it field. This step is to install Mysql.

If mysql is not installed, you need to install it. Look at installation of Mysql

Mysql Installation on windows. Linux Mysql installation is same, instead of installed from RPMs.

After installation of mysql need to configure PHP


Php configuration

Php.ini-recommended file is in php folder. php.ini doc Rename it php.ini and

extension_dir = "./"


extension_dir = "C:\php\ext"

Whatever is your path?

Now search for this lines and uncomments mysql line, this will run mysql database integration with php modules.


Save this file php.ini in windows folder. Copy this “php.ini” & “libmysql.dll” file into where your windows are installed. I installed windows in c drive.

So my path is
“C:\WINDOWS” or windows 2000 server it is “C:\WINNT”
To run mysql you need to copy “C:\php\libmysql.dll” this file to windows folder “C:\WINDOWS”



Apache Configuration

Php is installed in our path. So we need to set path for apache. By this apache will know where to compile php files and where is php’s compiler.
Apache php configuration is easy. “C:\Program Files\Apache Group\Apache2\conf” go this folder. Open “httpd.conf” file in any text editor. Search for

LoadModule access_module modules/
LoadModule actions_module modules/
LoadModule alias_module modules/
LoadModule asis_module modules/
LoadModule auth_module modules/
#LoadModule auth_anon_module modules/
#LoadModule auth_dbm_module modules/
#LoadModule auth_digest_module modules/
LoadModule autoindex_module modules/
#LoadModule cern_meta_module modules/
LoadModule cgi_module modules/”
#LoadModule ssl_module modules/

LoadModule php5_module "c:\php\php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

If you are using apache with different version

check this

for apache 1.x use module


apache 2.0.x use module


apache 2.2.x use module need (php 5.2.x )


Copy these three lines in httpd.conf file and save it.

Now you can check it whether php is integrated with apache or not
Make a simple info.php file


phpinfo(); — Outputs lots of PHP information,
This will give Outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License, Mysql database information extra. Mysql modules all information that are dynamic.

Copy this code in info.php file. Copy this php file
“C:\Program Files\Apache Group\Apache2\htdocs” folder. This is default folder of apache doc. http://localhost/ this path on web browser to run php files.
Now run info.php file on web browser http://localhost/info.php.

Apache Services restart

After installing and configure of apache php mysql, you need to restart finally apache.

Restart of apache services

and check output at browser http://localhost/info.php.

  follow EasyWayServer  
  HTML TagsNew  
JSP Tutorials New
Learn JSP in very less time with example and output. No more headache to scan books about JSP
JDBC Tutorials New
Learn JDBC in very less time with example.
Tomcat Clustering
Clustering is technique to improve the performance, high scalability, and failover of web-server or any servers. Number of users increase with increase load on the servers
Implementation of tomcat clustering
Simple steps to do tomcat clustering with code
Tomcat Installation & Configuration
Tomcat installation on windows, environment system variables setting in Visual mode for easy installation and configuration of web.xml other servlet invoker setting
Apache Tomcat integration with mod_jk
Integrate Apache web server with tomcat web server with mod_jk
Java Servlet Examples
Learn first servlet by example
Apache installation
Apache installation on windows and linux
Mysql Installation
Mysql installation on windows, Port setting,installing mysql tools query browser, connecting to database,creating database, creating tables
Apache PHP MySql integration

Keep up-to-date with all the latest articles, tutorials, reviews by subscribing to our newsletter.

Enter your email address:

Link to Us
If You Like this Article, share this

  Privacy Policy