Home / Language / English / Configure Apache Server, MySQL, PHP, and phpmyadmin

Configure Apache Server, MySQL, PHP, and phpmyadmin

This tutorial explains how to install and Configure Apache Server, MySQL, PHP, and phpmyadmin

The material of this tutorial is obtained from the book of Foundation PHP 5 for Flash by David Powers, friendsofed



download and install the latest version of Apache from its website. Just remember to set Network domain and Server name both as localhost. Choose the Typical/Complete setup option. To check if Apache is installed and running navigate to http://localhost/

To change the root folder (htdocs) edit the httpd.conf file(C:Program Filesapache Software Foundationapache2.2confhttpd.conf).
1.open it with notepad and search for DocumentRoot “C:/Program Files/apache Software Foundation/apache2.2/htdocs”
2.change it to DocumentRoot “D:/www”
3. also change the <Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”> to <Directory “C:/WWW”>
3.save it and restart the apache server.


Downloading and Installing PHP.
1. Download PHP latest zip package (Windows Binaries)
2. Unzip the package in c:programsphp5
3. There are more details in the file install.txt
4. locate the file php.ini-dist in the root folder , copy it and rename it to php.ini ( the settings in the php.ini-dist are more suited for the development purposes whereas the settings in the php.ini-recommended are suited for the production server and are more restricted)
5. find error_reporting = E_ALL & ~E_NOTICE | E_STRICT and set it to error_reporting = E_ALL to  Show all errors, also make sure this line is there: display_errors = On
6. change extension_dir = “./” to extension_dir = “c:Programsphp5ext”
7. Scroll down to the Dynamic Extension section. You can enable extra features by removing the semicolon from the begining of the extentions
8. enable mysql by removing semicolon from ;extension=php_mysql.dll and ;extension=php_mysqli.dll
9. set SMTP = smtp.example.com and sendmail_from = me@example.com
10. find ;session.save_path = “/tmp” and replace with session.save_path = “c:WINDOWSTemp”

11. add this (;C:Programsphp5) to the path variable of the System variables
12. also click New in the System variables and type PHPRC for the new variable name and C:Programsphp5 for the variable value
13. restart the computer

Configuring Apache to work with PHP

1. open the httpd.conf file in the apache installation folder
2. add LoadModule php5_module c:/Programs/php5/php5apache2_2.dll in the LoadModules sections
3.  add the default index files Here:
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
4. add  this line:  AddType application/x-httpd-php .php        between <IfModule mod_mime.c> or <IfModule mime_module> tag
5. save and close the config file, and restart Apache
6. if an error message appears saying : “The Apache service on Local computer started and then Stoped” or something then there is probabely an error in the config file. You can find the specific line that causes the error by running apache from the command prompt.

Installing MySQL

1. Chose the Current Release (Recommended)
MySQL 5.1—Generally Available (GA) release for production use
2. In the Windows downloads Pick a mirror for the Windows Essentials (x86) version
3. run the the file and follow the instructions on the screen


1. download the current release phpMyAdmin-3.2.3-all-languages.zip
2. unzip the phpMyAdmin folder to your document root of server (C:/WWW)
3. (Reference) To manually configure phpMyAdmin locate the config.sample.inc.php and create a copy from it and rename it to config.inc.php make the following change:
4.$cfg[‘PmaAbsoluteUri’] = ‘http://localhost/phpMyAdmin/’;
5.$cfg[‘Servers’][$i][‘extension’]     = ‘mysqli’;     // The php MySQL extension to use (‘mysql’ or ‘mysqli’)
$cfg[‘Servers’][$i][‘auth_type’]     = ‘http’;
// Authentication method (valid choices: config, http, HTTP, signon or cookie)
$cfg[‘Servers’][$i][‘user’]          = ‘root’;      // MySQL user
$cfg[‘Servers’][$i][‘password’]      = ”;
// MySQL password (only needed with ‘config’ auth_type)
If you are the only one using the computer chose ‘config’, ‘root’ and ‘your password’

7. Instead of manually editing config.inc.php, you can use the Setup Script. First you must manually create a folder config in the phpMyAdmin directory.
8. Next, open setup/ in your browser. Note that changes are not saved to disk until explicitly choose Save from the Configuration area of the screen.
9. Once the file has been saved, it must be moved out of the config/ directory to the installation root folder
10. If you are using the auth_type “config”, it is suggested that you protect the phpMyAdmin installation directory because using config does not require a user to enter a password to access the phpMyAdmin installation. Use of an alternate authentication method is recommended, for example with HTTP–AUTH in a .htaccess file or switch to using auth_type cookie or http

How do I change myphpadmin user/pass:

You need to change the values for the $cfg[‘Servers’][$i][‘user’] and $cfg[‘Servers’][$i][‘passwd’] in phpMyAdmin’s config file. Before you do that though, look at the value for $cfg[‘Servers’][$i][‘auth_type’]. If it’s “config”, then go ahead and change the username and password to whatever you want. If it’s “cookie” or “http”, then you need to create a new MySQL user account before you change those values.

Creating a Dreamweaver site

1. Select Site-Manage Sites – new
2. Choose Advance option , in the Local Info choose a name and enter the root folder (C:WWW)
3. Http Address is http://localhost/
4. If you plan to upload files to your server complete the Remote Info section (choose FTP)
5. select the Testing Server option , Server Model = PHP MySQL, Access = Local/Network, Testing Server for = C:WWW , and URL Prefix = http://localhost/

About Mohammad Khazab

این را هم ببینید

Diigo : Collect and Highlight, then Remember

Highlight and Add sticky notes on webpages Instead of just bookmarking, Diigo allows you to ...