Sessions
At the end of this session, the student will be able to:
PHP stands for Hypertext Preprocessor. It is an open source scripting language embedded within
HyperText Markup Language (HTML) codes and is used for developing dynamic Web pages. PHP scripts are executed on the Web server
PHP, created in 1994 by Rasmus Lerdorf originally stood for Personal Home Page. Rasmus Lerdorf
used a set of Perl scripts to maintain his personal home page and track access. These were replaced
with Personal Home Page Tools, which were a set of Common Gateway Interface (CGI) binaries written in C programming language. In order to add more functionality, these Personal Home Page Tools were incorporated with Form Interpreters (FI) to create an advanced version of PHP called PHP/FI. Form interpreters are a set of Perl scripts used by a form to process data from a Web form. PHP/FI enabled communication with databases and development of simple dynamic Web application.
In the year 1997, PHP/FI advanced to PHP/FI 2.0 with thousands of users installing it in approximately 50,000 server domains. However, PHP/FI 2.0 lacked extensive features which led to the development of PHP 3.0.
PHP 3.0 was the first version of PHP developed by Andi Gutmans and Zeev Surakshi in the year 1997.
This version supported different databases, protocols, and Application Programming Interfaces (APIs).
The developers used the extensibility feature of PHP 3.0 to add new features to it and enhance its
functionality. In addition, PHP 3.0 also provided object oriented syntax support.
In the year 2000, PHP 4.0 was released with security enhancements. PHP 4.0 provided support for multiple Web servers, HTTP sessions, output buffering, and security for user inputs. PHP 5.0 was released in the year 2004. PHP 5.3.6 was released in March 2011.
PHP is a scripting language suitable for server-side scripting and provides dynamic content from a Web
server to a Web client.
The advantages of using PHP are as follows:
Is easy to learn, use, and implement
Is freely available and can be customized
Can be executed on any Web server on any platform
PHP is a set of scripting tools used for performing various server-side functions. In addition, it can also be used for command line scripting and for developing client-side Graphical User Interface (GUI) applications that are platform independent.
The different uses of PHP are as follows:
Application Control - is specifically designed to control access logging for HTTP servers. Initially
it was used as an application control language.
is designed to act as a middleware to provide a Web interface for accessing a
database. PHP can access any Structured Query Language (SQL) or Open Database Connectivity
(ODBC) database and read and write data from these databases.
is used to work with files. It can read, write, and edit documents remotely. In other
words, it can be used for file and directory maintenance. PHP can also be used for generating
files in various formats, such as Portable Document File (PDF) and HTML. It is increasingly used
to process Extensible Markup Language (XML) data for HTTP distribution. It generates an e-mail
by retrieving data from documents and sending it through any standard mail protocol.
is used to create graphs and charts and generate image files, such as Graphics
Interchange Format (GIF) and Portable Network Graphics (PNG).
is designed to implement server scripts. The client requests will be
processed on the server. A PHP parser, a Web server, and a Web browser are required to
implement server-side scripting.
is used to execute scripts on the UNIX/Linux platforms. A Web server
and a Web browser are not required in command line scripting; only the PHP parser is required.
is used to create desktop applications with a GUI. Advanced features of
PHP can be implemented in client applications to enable interactive GUI.
PHP tools are used for developing and designing a Web page. They are text editors that allow developers
to design Web sites. PHP tools can be implemented after installation of PHP.
PHP tools are programming text editors containing all the supporting features that enable fast development
of Web sites. The tools that are used for developing dynamic Web pages are as follows:
Enables step by step execution and debugging of a PHP script without
changing the PHP code. It supports multiple debugging processes simultaneously. A PHP
Debugger simplifies PHP debugging because you can control the execution of PHP scripts without
changing the code. For example, using PhpED's PHP Debugger from NuSphere, you can perform
various PHP debugging operations including:
Inspecting PHP variable and class.
Modifying the value of a PHP variable.
Defining breakpoints to interrupt script execution.
Invoking a PHP function to view results.
Navigating through the code.
Viewing the line generating error.
Enabling secure debugging with Secure Shell (SSH).
Protects the PHP code and ensures security and runtime
performance.
Enables to encrypt both PHP and HTML code and protect Web pages.
Is a PHP build system, which enables to design a Web application in a structured manner.
Is an Integrated Development Environment (IDE) for PHP and a complete
platform for developing PHP based Web applications. It enables to create, debug, profile, deploy,
and integrate PHP code.
Is an IDE for PHP. Built on Eclipse platform, this tool comprises a set of
Eclipse editing, debugging, and deployment tools.
Is a combination of Dreamweaver and Microsoft Visual Studio and runs on a GNOME
platform to work with PHP. A GNOME platform is a desktop environment for Linux. This tool has
an object based design and a user friendly interface.
Provides a wireless text-messaging
platform. It enables to embed messaging services into an application, which can be sent to mobile
devices.
Is a Web development environment to edit XML,
HTML, PHP, and other text based Web documents.
Is an integrated Web development tool with different modules, such as server,
server setup, and client and plug-ins to access database servers, such as MySQL and Sybase.
Is a GNOME based text editor for writing PHP scripts. It is installed as the default text
editor in Linux operating systems.
PHP is an open-source scripting language. The source code can be downloaded for free from the official
PHP Web site. The version of PHP used is 5.3.6. You can download the php-5.3.6.tar.gz file from
http://www.php.net/downloads.php.
To install PHP, you must have a Web server and a database installed. The Web servers that support
PHP are as follows:
Some of the databases supported in PHP are as follows:
DB2
MSSQL
MySQL
Oracle
PostgreSQL
To install PHP, perform the following steps:
Right-click php-5.3.6.tar.gz files and select Extract Here. The contents are extracted to the
php-5.3.6 folder in the current directory.
Right-click php-5.3.6 folder and select Open In Terminal. The Terminal Window is displayed.
To configure the source code of PHP, enter the following command at the command prompt:
./configure --with-apxs2=/usr/local/apache2/bin/apxs
displays the output of the command.
make
displays the output of the command.
make install
displays the output of the command
The make install command copies the compiled binary files and the executables to their respective
locations. The installation of PHP is now complete.