Installing APACHE, MYSQL & PHP
Installing APACHE, MYSQL & PHP
Part - B
Samantha Mathara Arachchi
E-mail:ssp@ucsc.cmb.ac.lk
1
SSP
Feature in PHP
PHP is mainly focused on server-side scripting There are three main fields where PHP scripts are used Server-side scripting Command line scripting. You can make a PHP script to run it without any server or browser Writing client-side GUI applications PHP can be used on all major operating systems, including Linux, many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, Mac OS X, RISC OS
2
Feature in PHP
with PHP, you have the freedom of choosing an operating system and a web server you are not limited to output HTML. PHP's abilities includes outputting images, PDF files and even Flash movies PHP is its support for a wide range of databases PHP also has support for talking to other services using protocols such as LDAP, IMAP, SNMP, NNTP, POP3, HTTP, COM Free / Open source Language syntax is similar to Perl, C, and JavaScript.
3
The PHP script will be executed sequentially from the top to the bottom.
File extension If you open the page locally, (by mouse click) what will happen
Always executed just like the Nothing happens page from the Web (because (because Web browser it is client-side) cannot execute the script) You must upload to a PHP-enabled Web server in order to see the result 5
Development process
Development process
IMPORTANT: Development process of PHP is also different from JavaScript Edit PHP code with text editor or HTML editor (same as JavaScript) If your local PC is the Web server, copy php files into it If youre using another Web server, upload the file (.php) to it with FTP client View the file with Web browser by entering URL of the file
8
Installing PHP
Click or double on click php-4.3.2-installer.exe Welcome click License Agreement - I Agree Installation Type Standard Choose Destination Location - choose current (C:\PHP ) Next Mail Configuration
Please enter the address of your SMTP server (If you have a Mail server then enter that name otherwise enter localhost ) Please enter the 'from' address for the mail function (If you have a real mail account for this enter that otherwise keep default - me@localhost.com) Next
Server Type - Select the Apache Next Start Installation -Next OK Run Apache Finish
10
Installing PHP
Installing & Configuring PHP Where can it be obtained http://www.php.net Read related docs http://www.php.net/manual/en/install.windows.ph p Download PHP http://www.php.net/downloads.php (From PHP site) php-4.3.6 (Local machine)
11
Installing PHP
12
Installing PHP
13
Installing PHP
14
Installing PHP
15
Installing PHP
To find php.ini configuration file
16
Installing PHP
Php.ini configuration file
17
18
Installing PHP
To select htdocs folder..
19
Configuring httpd.conf
20
21
Apache
The Apache is the most popular web server Reports from netcraft.com indicate that Apache and its derivatives Apache does not run like a user application Instead it runs behind the scenes Providing services for other applications Apache is designed to work over a network Applications that talk to Apache can be on a different machine These applications are generally known as clients
22
Download Apache
apache_2.0.49-win32-x86-no_ssl.msi (or latest version)
Install Apache
1. Click on .msi file (apache_2.0.46-win32x86-no_src.msi) 2. Welcome page click next 3. License Agreement select Accept the terms in the license agreement 4. Read this click next
24
Install Apache
5.Server Information
a. Network Domain. Enter the DNS domain in which your server is or will be registered in. b. Server Name. Your server's full DNS name. c. Administrator's Email Address d. Enter the server administrator's or webmaster's email address here. This address will be displayed along with error messages to the client by default
25
Install Apache
6. For whom to install - Apache Select for All Users, on Port 80 8. Setup Type - Select Typical 9. Destination folder Keep Current path - click next 10. Install 11. Finish
26
Configurations Apache-2
Post Configurations Apache-2 - Edit httpd.conf Section 2: 'Main' server configuration (Check this)
ServerAdmin admin@admtc-int.lk ServerName BR01.admtc-int.lk:80
27
28
29
30
Test Apache
Apache will be listening on port 80 connect to the server and access launch a browser enter this URL http://localhost/ If nothing happens - look in the error.log file
31
32
33