This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SQ – http://sq.web.id – 1
How To Install Apache, PHP, MySQL, and PhpMyAdmin On Microsoft Windows 7
Author : A. SidiQ P. (DnD Sandy Ra) Email : [email protected] 1. Requirements & Directory Structure Assumption Requirements :
1. Apache 2.2.1 or Latest version o Select Win32 Binary without crypto (no mod_ssl) or Win32 Binary including
5. On the window “Apache HTTP Server 2.2 – Installation Wizard – Destination Folder”, click the “Change” button, and navigate to ".\DnDAMPP" directory under drive “C:\” (example : “C:\DnDAMPP\Apache2.2\”), and then click the “Next >” button.
6. On the next window, click the radio button "Custom", and then click the "Next >" button. 7. The next step wait for the finished installation.
SQ – http://sq.web.id – 5
8. To complete the installation process click the "Finish" button. You should see a window that looks like this :
9. To ensure that the apache installation has been done can work well, the next step open your favorite browser and type “ http://localhost ” in the address bar and press the button enter on the keyboard. If you will see “It works!” then your apache works fine.
1. Double click the installer (*.msi file, example : php-5.3.8-Win32-VC9-x86.msi). You will see a window that looks like this :
2. On the next window, click the “Next >” button. 3. Check the radio button "I accept the terms in the license agreement", and then click the
“Next >” button. 4. On the next window, again click the "Next >" button. 5. On the window “PHP 5.3.8 Setup – Destination Folder”, click the “Browse…” button, and
navigate to "DnDAMPP" directory under drive “C:\” (example : “C:\DnDAMPP\PHP\”), and then click the “Next >” button.
SQ – http://sq.web.id – 7
6. On the window “PHP 5.3.8 Setup – Web Server Setup”, click the radio button “Apache 2.2.x Module”, and then click the “Next >” button.
7. On the window “PHP 5.3.8 Setup – Select Apache Configuration Directory”, click the “Browse…” button, and navigate to ".\DnDAMPP\ Apache2.2\" directory under drive “C:\” (example : “C:\DnDAMPP\Apache2.2\conf”), and then click the “Next >” button. See the below image :
SQ – http://sq.web.id – 8
8. On the next window, click the "Next >" and “Install” button. 9. The next step wait for the finished installation. 10. To complete the installation process click the "Finish" button. You should see a window that
looks like this :
11. Restart your apache server,if your are getting any error just reboot your PC. 12. To ensure that the PHP installation has been done can work well, and then the next step
open your favorite text editor (example : Geany, Notepad, Intype, Etc) and copy/paste below code into it :
<?php
phpinfo()
?>
SQ – http://sq.web.id – 9
and then save as this file "phpinfo.php" in your apache document root directory (example : “C:\DnDAMPP\Apache2.2\htdocs”).
13. The next step open your favorite browser and type “ http://localhost/phpinfo.php ” in the address bar and press the button enter on the keyboard. If you will see the below page , then your PHP works fine.
1. Double click the installer (*.msi file, example : mysql-installer-5.5.17.0.msi), you will see there are three main options :
a. Install MySQL Products - The Installation Wizard. b. About MySQL - Learn about MySQL products and features. c. Resources - Information to help install and configure MySQL.
and then select “Install MySQL Product”.
2. Check the checkbox "I accept the the license terms", and then click the “Next >” button. 3. In the window “MySQL Installer - Find Latest Product” Check the checkbox “Skip the check
for updates (not recommended)”, and then click the “Next >” button. 4. In the window “MySQL Installer - Setup Type”,
a. Click the radio button “Developer Default”, b. On dialog “Installation Path” click the “…” button, and navigate to "DnDAMPP"
directory under drive “C:\” (example : “C:\DnDAMPP\MySQL\”), and then click the “Next >” button.
5. On the next window “MySQL Installer - Check Requirements”, and then click the “Next >” button.
6. On the next window “MySQL Installer - Installation”, you will be able to view a list of the MySQL components that are scheduled to be installed. Click the “Execute” button to install MySQL components.
7. The next step wait for the finished installation. 8. After finished installation, the next step is configuration.
SQ – http://sq.web.id – 11
a. You can watch the progress of this step in the “MySQL Installer – Configuration” window, and then click the “Next >” button.
b. On the next window “MySQL Installer - MySQL Server Configuration”, click the radio button “Developer Machine”, and then click the “Next >” button.
c. Next, choose your basic Network, Windows, and Security Settings, and then click the “Next >” button.
9. To complete the installation process click the "Finish" button. You should see a window that looks like this :
SQ – http://sq.web.id – 12
10. To ensure that the MySQL installation has been done can work well, and then the next step open your MySQL Command Line Client. To open MySQL Command Line Client Go to Start Menu All Programs MySQL MySql Server 5.5 MySQL 5.5 Command Line Client.
11. If you have seen window “MySQL 5.5 Command Line Client”, type your password in dialog “Enter password” and press the button enter on the keyboard. If you will see the below page , then your MySQL works fine.
SQ – http://sq.web.id – 13
5. PhpMyAdmin
Installation phpMyAdmin
1. Extract the zip archive (example : phpMyAdmin-3.4.7.1-all-languages.zip) to ".\DnDAMPP\ Apache2.2\htdocs" directory under drive “C:\” (example : “C:\DnDAMPP\Apache2.2\htdocs”). See the below image :
2. Rename the “phpMyAdmin-3.4.7.1-all-languages” directory to “phpmyadmin”.
3. Now open “httpd.conf” file in “C:\DnDAMPP\Apache2.2\conf\” directory a. Find these lines :
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
Add “index.php” after the “index.html“ and it looks like this :
4. Restart your apache server. 5. The next step open your favorite browser and type “ http://localhost/phpmyadmin ” in the
address bar and press the button enter on the keyboard. If you will see the below page, then your phpMyAdmin works fine.
6. If you can access phpMyAdmin, type your username and password in dialog “Log in” and click the button “Go”. You should see a window that looks like this :
Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv) ON mysql.user TO 'pma'@'localhost';
mysql> GRANT SELECT ON mysql.db TO 'pma'@'localhost';
mysql> GRANT SELECT ON mysql.host TO 'pma'@'localhost'; mysql> GRANT SELECT (Host, Db, User, Table_name, Table_priv,
Column_priv) ON mysql.tables_priv TO 'pma'@'localhost';
d. Run phpMyAdmin's sql script file 'create_tables.sql' and then grant permissions.
mysql> source C:\www\phpMyAdmin\scripts\create_tables.sql mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO
'pma'@'localhost'; mysql> quit
4. After completion of your configuration, please logout from phpmyadmin and login again.
SQ – http://sq.web.id – 18
6. Directory To Save The Program PHP and MySQL MySQL
If you create databases and tables with MySQL, then by default your database will be stored in a directory “C:\ProgramData\MySQL\MySQL Server 5.5\data”.
PHP
If you create a program with PHP, so can be run on localhost, then it must be stored in ".. \htdocs" directory.