A Note on PHP
What is PHP ?
PHP is a scripting language, embedded in HTML and used to generate dynamic web pages. It is a major programming language and web technology, used widely these days in the world of internet. It is a scripting language which means it can be interspersed with HTML and generate high quality dynamic content of web page.
PHP is the recursive acronym for "PHP: Hypertext Preprocessor". It is a scripting language and need PHP processor to read and execute its code. Since PHP4 "Zend Engine" is being used as PHP processor.
1. PHP is a server-side scripting language and is embedded in HTML web pages. It is used to generate and manage high quality dynamic contents, read databases, managing session and tracking cookies, file reading and writing and other major function, a server side language must have.
2. It supports numbers of databases like MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Sybase etc.
3. PHP is very fast and require less execution time than any other programming language. Database searches are unbelievably faster.
4. PHP supports all major protocols like POP3, IMAP, and LDAP.
5. Syntax of PHP comes from C and JAVA.
6. PHP is interpreted language, which means it gets executed line by line.
Components needed to develop in PHP
To develop and run web pages in PHP, three components are vital :
1. Web server
3. PHP Parser
The History of PHP
- PHP was written by Rasmus Lerdorf in 1994 in the C programming language to use in monitoring his personal information. For this reason, PHP originally stood for "Personal Home Page".
- Combined with his own form interpreter, Rasmus released PHP publicly as PHP/FI in 1995 generally known as PHP 2.0.
- Zeev Suraski and Andi Gutmans, redeveloped PHP core and release PHP/FI 2 in 1997 and changed the acronym to "PHP: HyperText Preprocessor".
- PHP 3 was released is 1998 and it was the first widely used version of PHP.
- In 2000, PHP core was replaced by Zend Engine 1.0 and PHP 4.0 was released. It was more reliable than PHP 3.0 and speed was improved significantly. Object oriented programming was included in this version of PHP.
- PHP 5 was released in 2004 with improved zend engine 2.0 with many more features like improved OOPS, embedded SQLite, better XML tools, exception handling using try...catch etc.
- PHP 6 with unicode support was developed in 2005 but was never released.
- PHP 7 was released in 2015 and is available at present.
Major PHP Release
September 2002March 2002
The mascot of the PHP project is the elePHPant, a blue elephant with the PHP logo on its side, designed by Vincent Pontier in 1998.
<!DOCTYPE html> <html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html>
Look at code given above. PHP code is embedded in HTML and defined by its delimiters "<?php" and "?>". PHP interpreter reads code written between PHP delimiters and ignores everything else written outside.
Use of PHP
PHP is a scripting language and is a server side web development technology. It runs on web server. Configuration of PHP is done within web server configuration file like apache.conf for apache web server. PHP code written inside a requested web page is executed by PHP runtime parser which in turn create dynamic web contents. You can also use it with command line interface. PHP can be deployed on all types of operating systems and platforms and works with almost all web servers available. But preferred web server for PHP is apache. It supports all major databases.
The architecture known as LAMP has become popular in the web industry as a way of deploying web applications.LAMP is the acronym for Linux, Apache, MySQL and PHP. It is package of software need to run a web application. Similar packages, WAMP and MAMP, are also available for Windows and OS X.
© 2018 Lalit Kumar