Sunteți pe pagina 1din 4

PHP INTRODUCTION

What is PHP ?
PHP is a server-side scripting language. Now you may be thinking how a scripting
language differs from a programming language. A scripting language does something
only in response to the event while a programming language can do the things even
when it is not responding to events. Javascript is another popular scripting language that
runs on the client side while PHP runs on the server-side. Here server-side means
webserver and client side means user's web browser. So PHP will going to be executed
on the webserver and not the client browser. Since PHP runs on the webserver thus its
not going to run on its on. So it needs a webserver but it will run as it is, that means it
does not need to be compiled like other programming languages lets say : C, C++, JAVA
etc etc. Thus we create PHP program and put it on webserver and we are ready to go.
PHP is designed for use with HTML. PHP code is our input and webpage is our output.
We will save the PHP document with the .php extension so that the webserver will know
that it is a PHP document.
PHP provides more flexibility than HTML alone does. HTML pages are static by nature
and it will show the same pages all the time but PHP let us create dynamic pages. The
page content changes based on the conditions such as interaction with the user or data
stored at the database.
PHP syntax is very similar to C, JAVA,PERL. And if you have knowledge of any of
these languages already, you can recognize the similarities but if you don't have
knowledge of any of these languages then don't worry you don't have to learn any
language before you learn PHP. The only foundation you should have to learn PHP is
HTML.

History of PHP
The version 1 of the PHP was written by Rasmus Lerdorf in 1994 and it was CGI binaries in
C programming language. He was looking for a way to maintain his webpage easier.
The version 2 written in 1995 was more formal version. This was the improved version
of the original version and also combined with the code to interpret information
submitted by web forms and this was the first public release of PHP. At this point PHP
stands for the Personal Home Page Tools.
In version 3, the things changed in 1998. They renamed it “PHP : Hypertext
Preprocessor”.
In version 4, the things changed again by forming the new company called zend
technologies and zend wrote the core of PHP. It was full-featured and was released in
May, 2000. now PHP group maintains PHP and zend technologies (company) actively
guides the developments on the PHP we are using.

© Sourabh Bhandari http://sourabhandari.in


The version 5 came out in 2004 which was another improved version of the zend
engine. PHP5 includes lots of new features like Object Oriented Programming and better
database connectivity.
The version 3, 4, 5 are supported by web browsers and version 4 & 5 are available for
updates.

Now whatever we will discuss in our tutorials here will be executed by PHP 4 & 5.

Why use PHP ?


Now the question arises is why we use PHP instead of other web-technologies ? There
are many reasons to use PHP as listed below :
1. First one is that you discovers the limitation of HTML and you want more. PHP is
open source and free software. Open source means source code is available for
everyone to study, to use or to modify ie if some developer apart from zend
technologies wants to change the way the PHP works that can. Its free to
download and free to use. Its free to download and free to use.
2. PHP is also cross-platformed to develop, to deploy and to use. Here cross-
platformed means we can put PHP on windows server, mac server, Linux server
with no problem and we can deploy it in all platforms. Thus by learning this one
language we are not tying ourselves to one type of hardware or operating system.
3. PHP is also powerful, robust and scalable.
4. PHP is web-development specific ie it is written in beginning with the web-
development in mind and functions defined in PHP are for web usage.
5. PHP can be object oriented especially with the version-5 onwards.
6. PHP has great documentation in many different languages. Check out the
documentation at http://www.php.net/docs.php.
7. PHP has large active developer community. Over 20 million websites use PHP. It
is the fourth most used programming language of all. That large developer
community has already created great applications/tools like wordpress, joomla,
phpBB, membo, mediawiki etc etc. These are free to download that you ca use to
create blogs, forums, bulletin boards etc. By learning PHP you can use these tools
more effectively, efficiently and customize them your specific needs.

Installation
In order to install PHP on your local machine (computer), you will need the following :
1. Webserver: we will install it on our local machine.
2. PHP: we will install PHP so that webserver will understand PHP documents that
we create and serve them to web-browser.
3. Database: We gone a have database so that we can create applications that are
more full-featured.

© Sourabh Bhandari http://sourabhandari.in


4. Text-Editor: we need text-editor to write and modify our PHP code.
5. Web browser: Finally we need a web browser. Any web browser can work for
you viz. firefox, internet explorer, safari etc.

Installation overview
We can use any of the following packages:
1. LAMP (LINUX – APACHE – MYSQL – PHP)
2. WAMP (WINDOWS – APACHE – MYSQL – PHP)
3. MAMP (MAC – APACHE – MYSQL – PHP)
4. XAMPP (FOR ALL VIZ. LINUX, WINDOWS, MAC)

Windows intallation
To install PHP on windows you will need following prerequisites:
1. PHP requires:
Windows 98/Me or
Windows NT/2000/XP/2003/Vista/7.
2. Apache:
httpd.apache.org
3. PHP:
http://www.php.net
4. MYSQL:
http://dev.mysql.com

you can install these modules of PHP manually as listed above or you can choose all in
one package either WAMP or XAMPP as listed below:
1. WAMP:
http://www.wampserver.com/en/index.php
2. XAMPP:
http://www.apachefriends.org/en/xampp-windows.php

I'll use WAMP in these tutorials so you can install WAMP on you machines. Other
packages can also equally work well.

Text-Editor
The text editor that you can use to write PHP code can be any out of these :
1. Dreamweaver, Zend studio, kromo-edit, notepad++.
2. Word processors are not good for PHP editing. Since they put in lots of other
information like page margin etc. So don't use word processors for PHP editing.
3. Notepad will work for PHP editing.

© Sourabh Bhandari http://sourabhandari.in


You can use any of these editors and if you have some other editor, it can work equally
well PHP editing.

© Sourabh Bhandari http://sourabhandari.in

S-ar putea să vă placă și