0% found this document useful (0 votes)
14 views7 pages

PHP Unit

Uploaded by

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

PHP Unit

Uploaded by

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

1.

Origin of PHP:

 PHP stands for : “Hypertext Pre-processor" and also called


“Personal Home Page”.
 PHP is a server side scripting language that is embedded in HTML.
It is used to manage dynamic content, databases, session tracking,
even build entire ecommerce sites.
 It is integrated with a number of popular databases, including My
SQL, Postgre SQL, Oracle, Sybase, Informix, and Microsoft SQL
Server.
 PHP is pleasingly zippy in its execution, especially when compiled
as an Apache module on the Unix side. The My SQL server, once
started, executes even very complex queries with huge result sets
in record-setting time.
 PHP supports a large number of major protocols such as POP3,
IMAP, and LDAP. PHP4 added support for Java and distributed
object architectures (COM and CORBA), making n-tier
development a possibility for the first t.
 PHP is forgiving: PHP language tries to be as forgiving as possible.
 PHP Syntax is C-Like.
 Common uses of PHP.

2.PHP is better than its alternatives:

 It is faster to code and faster to execute.


 The same PHP code runs unaltered on different Web servers and
different operation systems.
 Additionally, functionality that is standard with PHP is an add-on
in other environments. A more detailed argument follows.
 PHP is free. Anyone may visit the PHP Web site and download the
complete source code. Binaries are also available for Windows.
The result is easy entry into the experience. There is very little risk
in trying PHP, and its license allows the code to be used to develop
works with no royalties.
 This is unlike products such as Allaire's Cold Fusion or Everyware's
Tango Enterprise that charge thousands of dollars for the software
to interpret and serve scripts. Even commercial giants like
Netscape and IBM now recognize the advantages of making
source code available.
 PHP runs on UNIX, Windows 98, Windows NT, and the Macintosh.
PHP is designed to integrate with the Apache Web Server.
 Apache, another free technology, is the most popular Web server
on the Internet and comes with source code for UNIX and
Windows. Commercial flavors of Apache like Web Ten and
Stronghold support PHP, too.  But PHP works with other Web
servers, including Microsoft's Internet Information Server. Scripts
may be moved between server platforms without alteration. PHP
supports ISAPI to allow for the performance benefits of tightly
coupling with Microsoft Web servers.

3.How PHP works with the web server

 The PHP software works with the web server, which is the software
that delivers web pages to the world.
 When we type a URL into our web browser’s address bar, we are
sending a message to the web server at that URL, asking it to send me an
HTML file. The web server responds by sending the requested file. Our
browser reads the HTML file and displays the web page.
 we also request a file from the web server when we click a link in a
web page.
 In addition, the web server processes a file when you click a web
page button that submits a form. This process is essentially the same
when PHP is installed. You request a file, the web server happens to
be running PHP, and it sends HTML back to the browser, thanks to
the programming in PHP
 More specifically, when PHP is installed, the web server is configured
to expect certain file extensions to contain PHP language
statements.
 Often the extension is .php or .phtml, but any extension can be used.
When the web server gets a request for a file with the designated
extension, it sends the HTML statements as is, but PHP statements
are processed by the PHP software before they’re sent to the
requester.
 When PHP language statements are processed, only the output, or
anything printed to the screen is sent by the web server to the web
browser.  The PHP language statements, those that don’t produce
any output to the screen, aren’t included in the output sent to the
browser, so the PHP code is not normally seen by the user.
 For instance, in this simple PHP statement,<?php is the opening tag,
and ?> is the closing tag.
 <?php echo “<p>Hello World</p>”; ?>
 Here, echo is a PHP instruction that tells PHP to output the
upcoming text. The PHP software processes the PHP statement and
outputs the following:
 <p>Hello World</p>
 That regular HTML statement is delivered to the user’s browser. The
browser interprets the statement as HTML code and displays a web
page with one paragraph — Hello World. The PHP statement isn’t
delivered to the browser, so the user never sees any PHP
statements. PHP and the web server must work closely together.

4. Hardware and Software Requirements and installation:

These are the following the software requirements


 WAMP Server
 LAMP Server
 MAMP Server
 XAMPP Server
All these types of software automatic configure inside operating system
after installation it having PHP, My SQL, Apache and operating system
base configuration file, it doesn't need to configure manually.
Server Stands for
 WAMP Microsoft window o/s, Apache Mysql PHP
 LAMP Linux Operating System Apache Mysql PHP
 MAMP Mac os Apache Mysql PHP
 XAMPP x-os(cross operating system)
 Apache Mysql PHP Perl

5.Hardware Requirements

If we would like to use a dedicated hosting server for running PHPKB


(Knowledge Base Software or host) on a local server, we can use hardware
requirements and example specifications below for a reference.
Recommended Hardware Specifications

 On small instances, server load is primarily driven by peak visitors however

 we may use the following specifications for optimal performance.


 5 Concurrent Users
 25 Concurrent Users
 50 Concurrent Users
 1 GHz CPU
 2 GB RAM
 GB disk space
 Dual 2 GHz CPU
 4 GB RAM
 1 GB disk space
 Dual 2.6 GHz CPU
 8 GB RAM
 4 GB disk space

6.The PHP Installer :

Although an installer is available from php.net, I would recommend the

 manual installation if we already have a web server configured and


running. Manual Installation
 Manual installation offers several benefits:
 Backing up, reinstalling, or moving the web server can be achieved in
 Seconds (see 8 Tips for Surviving PC Failure) and you have more control
over PHP and Apache configuration

Step 1: Download the files

 Download the latest PHP 5 ZIP package from


www.php.net/downloads.php
 As always, virus scan the file and check its MD5 checksum using a tool .

Step 2: Extract the files


 We will install the PHP files to C:\php, so create that folder and extract
the
 Contents of the ZIP file into it. PHP can be installed anywhere on our
system, but we will need to change
 The paths referenced in the following steps.

Step 3: Configure php.ini

 Copy C:\php\php.ini-development to C:\php\php.ini. There are several


lines
 We will need to change in a text editor (use search to find the current
setting). Where applicable, we will need to remove the leading
semicolon to uncomment these setting.

Define the extension directory:

extension_dir = "C:/php/ext"

Enable extensions.

This will depend on the libraries we want to use, but the following extensions
should be suitable for the majority of applications:

extension=curl

extension=gd2

extension=mbstring

extension=mysql

extension=pdo_mysql

extension=xmlrpc

Step 4: Add C:\php to the path environment variable


 To ensure Windows can find PHP, you need to change the path
environment variable.
 Open Settings, type ‘environment variables’ into the search field and
open the result.
 Select the “Advanced” tab, and click the “Environment Variables”
button.
 Scroll down the System variables list and click on “Path” followed by
the
 “Edit” button. Click “Edit text” and add ;C:\php to the end of the
Variable value line (remember the semicolon).

7.How PHP script work :

 PHP always start with a browser making a request for a web page.
 This request is going to hit the web server. The web server will then
analyze it and determine what to do with it.
 If the web server determines that the request is for a PHP file (often
index.php ), it’ll pass that file to the PHP interpreter. The PHP
interpreter will read the PHP file, parse it (and other included files)
 And then execute it. Once the PHP interpreter finishes executing the
PHP file, it’ll return an output. The web server will take that output and
send it back as a response to the browser.

You might also like