Title: Chapter 2 Windows, Apache, MySQL, PHP (WAMP)
1Chapter 2Windows, Apache, MySQL, PHP (WAMP)
Install GuidePHP Programming with MySQL
2Objectives
- Install and configure a Web server
- Install and configure PHP
- Install and configure MySQL
3Understanding Binary and Source Code Installations
- Binary format (or binaries) refer to compiled
files, such as executable installation programs - Source code is the original programming code in
which an application was written - Source code must be compiled, or processed, and
assembled into an executable format before it is
used - Compiled programs only need to be recompiled when
their code changes
4Installing and Configuring a Web Server
- Apache is the most popular Web server software
used on the Internet - Microsoft IIS for Windows is the second most
popular server software. - In Windows, a service refers to a program that
performs a specific function to support other
programs
5Installing and Running Apache on Windows
- Go to http//www.apache.org/dyn/closer.cgi/httpd/b
inaries/win32/ - Select a mirror download site. One will be
suggested at the top. - Download the Win32 Binary without crypto (no
mod_ssl) (MSI Installer) httpd-2.2.16-win32-x86-n
o_ssl.msi installation file - Navigate to the installation file and from the
Welcome screen, click Next - Accept the terms of the License Agreement, click
Next - Read the contents of the Read This First screen,
click Next
6Installing and Running Apache on Windows
(continued)
- Accept the default values, click Next
- Select a Typical installation, click Next
- Accept the default Destination Folder directory,
click Next - Click Back to make changes or click Install to
finish - Click Finish
7Testing Your Web Server
- Open your Web browser
- Type http//localhost/ in the Address box, click
Enter -
-
- Figure 2-2 Apaches default Web
page
8Configuring Apache
- To configure ports and other settings you must
edit the httpd.conf file - For Windows
- C\Program Files\Apache Group\Apache2\conf
- Lines that begin with the pound sign () are
informational comments - Lines without pound signs contain directives
9Configuring Apache (continued)
10Configuring Apache (continued)
- Directives define information about how a program
should be configured - The DocumentRoot directive identifies the default
directory from where Apache serves Web pages.
Set this to the complete address of the folder
you wish to serve pages from. - There is also a ltDirectory gt setting that must
be set to the same directory as your DocumentRoot
directive. - The Alias directive identifies other directories
that Apache can use to serve Web pages
11Installing PHP Windows Running Apache
- Go to http//us.php.net/downloads.php
- Select and download PHP 5.2.14 installer
- Select a mirror to download from. Save the file
to your computer. - Once downloaded, navigate to the installation
file and from the Welcome screen, click Next or
follow directions. - In the License Agreement screen, click I Agree
- In the Installation Type screen, select Standard,
then click Next - Accept the default destination location, click
Next
12Installing PHP Windows Running Apache (continued)
- In the Mail Configuration screen, accept the
default values of localhost, click Next - In the Server Type screen, select the type of Web
server that you want to use with PHP, click Next - In the Start Installation screen, click Next to
begin installation - Click OK to close the dialog box of the Web
server you selected
13Configuring Apache for PHP on Windows
- Click the Start menu and point to All Programs
- Select the Edit the Apache httpd.config
Configuration File command - Add the following to the end of the
fileScriptAlias /PHP/ C/PHP/AddType
application/x-httpd-php .phpAction
application/x-httpd-php /PHP/php-cgi.exe - Save and close the httpd.conf file
- Restart Apache
14Configuring PHP
-
- Figure 2-6 The php.ini configuration file
15Installing and Configuring MySQL on Windows
- Go to http//dev.mysql.com/downloads/ Click
download button under MySql Community Server - Scroll down and select Windows (x86, 32-bit), MSI
Installer Essentials - Recommended - Navigate to the install file and run it.
- In the Welcome screen, click Next to start the
installation - Accept the default setup type Typical, click
Next - Click Back to make changes or click Install to
continue
16Installing and Configuring MySQL on Windows
(continued)
- Choose skip sign-in, click Next
- In the Wizard Completed screen, click Finish
- In the first screen of the MySQL Server Instance
Configuration Wizard, click Next - In the Configuration Type screen, select Standard
Configuration, click Next
17Installing and Configuring MySQL on Windows
(continued)
- In the Windows Options screen, accept the default
values (do not select the Include Bin Directory
in Windows PATH check box), click Next - In the Security Options screen, deselect the
Modify Security Settings check box, click Next - Click Back to change any of the configuration
operations or Execute to finish
18Testing the MySQL Server
- Check to see if MySQL is running
- For Windows, use the Services window (Task
Manager gt Services tab) - Run the mysqladmin version command
- For Windows, change to the C\Program
Files\MySQL\MySQL Server 5.0\bin\ directory and
run - mysqladmin version
19WAMP/MAMP/XAMMP
- All in one download and installation for Windows
- http//www.wampserver.com/en/
- Another All in one download for Windows, MAC,
Linux, Solaris - http//www.apachefriends.org/en/xampp.html
- All in one download and installation for MAC
- http//www.mamp.info/en/index.html