0% found this document useful (0 votes)
44 views18 pages

Chapter 2-Part 1

Uploaded by

s7jkj8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views18 pages

Chapter 2-Part 1

Uploaded by

s7jkj8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Chapter 2

Introduction to PHP

Part 1
1.1 Web Development Environment Components

Web Server - A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form
Web pages to users, in response to their requests, which are forwarded by their computers' HTTP clients.

Examples of web servers:


Apache Web Server
Microsoft Internet Information Services (IIS)

Code Editors - A source code editor is a text editor program designed specifically for editing source code of computer
programs by programmers. It may be a standalone application or it may be built into an integrated development
environment (IDE) or web browser. There are a lot of code editors available on the Internet for free or for a low price.

Examples of Code Editors:


Notepad++
Microsoft Expression Web 4
Web Development Environment Components….
Integrated Development Environment (IDE) - An integrated development environment (IDE) is a software
application that provides comprehensive facilities to computer programmers for software development. An IDE
normally consists of a source code editor, build automation tools and a debugger.
Examples of IDE:
Aptana Studio PHP Editor(Free) - www.aptana.com
NetBeans IDE(Free) - netbeans.org
Eclipse PDT (Free)- www.eclipse.org
Zend Studio - www.zend.com/en/products/studio
Scripting Language - In developing a web application, both client-side and server-side scripting languages are
required.
Examples of Client-Side Programming Languages and Frameworks
HTML and CSS
AJAX (JavaScript + XML)—a technology that allows specific parts of a site to be updated without a full-page refresh
by asynchronously connecting to the database and pulling JSON– or XML-based chunks of data.
VBScript & JScript are Microsoft’s front-end scripts that run on the ASP.NET framework. JScript is Microsoft’s
reverse-engineered version of JavaScript.
PHP, Ruby on Rails, ASP, Python and many others
Web Development Environment Components….
Database Management System (DBMS)

A database management system (DBMS) is a computer software application that interacts with the user,
other applications, and the database itself to capture and analyze data.

Examples of DBMS:
MySQL
Oracle
SQL Server
MariaDB

What is a Software Stack?

“Stacks” are bundles of software that comprise your site’s back end—everything from the operating system
and web servers to APIs and programming frameworks.

Each component provides a layer for their compatibility, and bundling them makes them easier to download
and deploy all at once.
Parts of Software Stack
.
Software stack….
Applications have four tiers, three of which are on the server-side.

This graphic explains the inner workings of a stack: the client is where it all starts and ends.

The client tier—this is the only component in the browser

The web tier—the web server, or HTTP server

The business tier—the application server, including the development platform, frameworks,
and server-side programming languages

The database tier—the database server you choose, which can often depend on the
business tier

The tiers each include an operating system, server, database and server-side
scripting
language. You’re not limited to the components in a stack—they’re interchangeable based
on your needs and customizable.
Practical
Part
1.2 Apache Webserver (WAMP) Configuration and Testing
WAMPSERVER
WampServer is a Windows web development environment. It allows you to create web
applications with Apache2, PHP and a MySQL database. Alongside, PhpMyAdmin and
Adminer allows you to manage easily your databases.
http://localhost/
http://localhost/phpmyadmin/
http://localhost/adminer/

Downloading and Installing


WampServer
WampServer is available for free (under GPML license) in two distinct versions: 32 and 64
bits. Wampserver 3.0.6 is the current used.
Steps in install WampServer
Go to Downloads in the WampServer website :
http://www.wampserver.com/en/#download-wrapper
Setting up a local web server……..
Setting up a local web server…….
Check the System type of your computer in the System Properties if it is 32-bit or 64-bit.
Setting up a local web server…..
Download the appropriate installer for your computer.
Follow the instructions in the installer.
Setting up a local web server…..
Testing the Installation
Accessing the localhost

• Localhost is a hostname that


means this computer.
• It is used to access the network services that are running on the host via its
loopback network interface.
• Localhost resolves to the IP address 127.0.0.1, which is the
most commonly used IPv4 loopback address.
• You can open a browser and type: http://localhost or http://127.0.01
to check if you have successfully installed the web server.
Setting up a local web server…..
Running the Localhost
Setting up a local web server…..
Executing phpinfo()
Because every system is setup differently, phpinfo () is commonly used to check configuration settings and for available
predefined variables on a given system.
phpinfo () is also a valuable debugging tool as it contains all EGPCS (Environment, GET, POST, Cookie, Server) data. It is
advisable to run phpinfo () before starting any development so you will be aware of the settings of your development
environment.
Methods of executing phpinfo ():
Creating your own phpinfo.php file. Create a new PhP script executing the phpinfo () function and
save in your document root. Open the browser and load the phpinfo.php file.
<?php phpinfo(); ?>
Setting up a local web server…..
Using Wampserver Tools. WampServer has Tools section which
provides a link to a phpinfo () script. You can click on this link and
the phpinfo () will be loaded.
Setting up a local web server…..
Setting Projects and access them from Localhost. In the new
version of wamp server , $suppress_localhost parameter need to
be set to false in the index file that is available in www root folder.
APACHE WEB SERVER CONFIGURATION
HTTD.CONF
Apache HTTP Server is configured by placing directives in plain text configuration files. The main configuration
file is usually called httpd.conf. The location of this file if using WAMPSERVER in Windows environment is: C:\
wamp64\bin\apache\Apache2.4.x\conf. Any directive may be placed in any of these configuration files.
Changes to the main configuration files are only recognized by httpd when it is started or restarted.
Default Page / Index Page
This option will tell Apache which file to serve/load if a directory is being requested. For example, if you want
your index.php as the first page to open when your folder is requested from the browser, you would include
index.php in this option.
APACHE WEB SERVER CONFIGURATION….
Changing Document Root
You can change the location where Apache stores your web pages by modifying two
configurations. The default location is C: /wamp64/www. Suppose you want to save your
files in D:\www, you have to change the two settings.
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Figure : Document Root Setting (httpd.conf)

You might also like