PHP: Hypertext Preprocessor Introduction

Post on 28-Nov-2014

2.818 views 3 download

description

Simple introduction to PHP for someone who does not know what PHP is and how was born.

Transcript of PHP: Hypertext Preprocessor Introduction

PHP: HypertextPreprocessor

Oto Brglez | September 2008otobrglez@gmail.com

http://heapsoft.comhttp://opalab.com

What is PHP?

PHP is a computer scripting language.Originally designed for producing dynamic web pages.PHP is program that generally runs on a web server,

taking PHP code as its input and creating web pages as output.

PHP is installed on more than 20 million websites and 1 million web servers.

PHP can be used free of charge, because it’s open source project.

PHP has syntax similar to C/C++

History of PHP Began in 1994 as a set of Common Gateway Interface(CGI) binaries written in the C programming

language by the Danish/Greenlandic programmer Rasmus Lerdorf.

Lerdorf released PHP publicly on June 8, 1995 to accelerate bug location and improve the code. (PHP 2)

Zeev Suraski and Andi Gutmans, two Israeli developers, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism PHP: Hypertext Preprocessor.

Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999.

On May 22, 2000, PHP 4, powered by the Zend Engine 1.0, was released. On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II.

As of August, 2008 this branch is up to version 4.4.9.PHP 4 is no longer under development nor willany security updates be released.

In 2008, PHP 5 became the only stable version under development.

PHP 6 is under development alongside PHP 5.

What do i need to “do” PHP?

Operating System (Windows, Linux, OS/X, Solaris…)

Web Server (Apache, IIS…)PHP (Source, Binary od Package)Database (MySQL, MSSQL, Oracle,…)

L = LinuxA = ApacheM = MySQLP = PHP

How PHP works?

User sends HTTP request to Web Server from his Web Browser.

Web server validates request and parses key parameters. This parameters are then sent to PHP program installed on system.

PHP parses .php script and outputs HTML document.

HTML document produced by PHP is then served by the Web Server as response to users HTTP request.

What is PHP script?

Script is text document.Script usualy has .php extension.Script is located on web server.Scripts can be made from PHP code and

HTML code.

How does PHP script look like?

<?php$a = 10; // Komentar ;)$a = “Test”;

for($i=0; $i<=10; $i++){print(“Zdravo svet! <br/>”);

}

$imena[] = “Oto Brglez”;

?>

Why is PHP sow successful?

PHP is realy realy FAST!It has simple syntaxIt’s weak typedNo compilingOpen source codeLong historyModularity of PHP coreMany developersRealy good documentation project

(docs.php.net)

How to start with PHP?

Go to www.php.netRead geting startedDo a simple tutorial

Visit http://docs.php.net and explore the documentation provided by PHP comunity

Buy a book or read online tutorials

Strange PHP facts

You can write desktop applications in PHP using PHP-GTK lib.

You can run PHP on Symbyan OS on Nokia (S60) mobile phones.

You can run PHP on Pocket PC (Pocket HPH project).NanoWeb is web server written in PHP.WinBinder allows PHP programmers to easily build

native Windows applications. Bambalam PHP EXE Compiler/Embedder is a free

command line tool to convert PHP applications to standalone Windows .exe applications.

My projects…

Oto Brglez | September 2008