Tuesday, December 18, 2012



What is PHP?
  • HP stands for PHP: Hypertext Preprocessor.
  • PHP is a widely used general-purpose scripting language that is especially suited for web development and can be embedded into HTML (http://www.php.net).
  • The main goal of the language is to allow web developers to write dynamically generated web pages quickly.
  • PHP was conceived in 1994 and was originally the work of one man, Rasmus Lerdorf.
  • It was adopted by other talented people and has gone through four major rewrites to bring us the broad, mature product we see today.
  • As of November 2007, it was installed on more than 21 million domains worldwide, and this number is growing rapidly.
  • PHP is an Open Source project, which means you have access to source code and can use, alter, and redistribute it all without charge.
  •  PHP originally stood for Personal Home Page, but was changed in line with the GNU recursive naming convention (GNU = Gnu’s Not Unix) and now stands for PHP Hypertext Processor.
  • The current major version of PHP is 5. This version saw a complete rewrite of the underlying Zend engine and some major improvements to the language
  • The home page for PHP is available at http://www.php.net
  • The home page for Zend Technologies is http://www.zend.com.

Features of PHP
  • As a programming language for the Web, PHP is hard to ignore.
  • Clean syntax, an extensible architecture that encourages innovation, support for both current and upcoming technologies and protocols, and excellent database integration are just some of the reasons for the popularity it currently enjoys in the developer community.

Reasons to Love PHP
  1. Cost
  2. Simplicity
  3. Stability
  4. Portability
  5. Speed
  6. Open Source
  7. Extensible




Cost

  • PHP costs you nothing, not one red cent.
  • Nothing up front, nothing over the lifetime of the application, nothing when it’s over.
  • Not to mention that the Apache/PHP/MySQL combo runs great on cheap, low-end hardware.

Simplicity
  • PHP uses a consistent and logical syntax.
  • In fact, the quickest way to learn PHP is to step through the manual’s introductory tutorial, and then start looking at code samples off the Web.
  • This adherence to the KISS (Keep It Simple, Stupid) principle has made PHP popular as a prototyping and rapid application development tool for web applications.
  • PHP can even access C libraries and take advantage of program code written for this language, and the language is renowned for the tremendous flexibility it allows programmers in accomplishing specific tasks.


Stability
  • The word stable means two different things in this
  • The server doesn’t need to be rebooted often.
  • The software doesn’t change radically and incompatibly from release to release.

Portability
  • The ease with which a program can be made to work on different platforms—is an important factor.
  • PHP users have little to fear here, because cross-platform development has been an important design goal of PHP since PHP 3.0.


Speed
  • The MySQL server, once started, executes even very complex queries with huge result sets in record-setting time.
  • PHP5 is much faster for almost every use than CGI scripts. There is an unfortunate grain of truth To the joke that CGI stands for “Can’t Go Instantly.”



Open Source Licensing
  • Possibly the best thing about PHP is that it’s free—its source code is freely available on the Web, and developers can install and use it without paying licensing fees or investing in expensive hardware or software.
  • Using PHP can thus significantly reduce the development costs of a software application, without compromising on either reliability or performance.
  • The open-source approach also ensures faster bug fixes and quicker integration of new technologies into the core language, simply due to the much larger base of involved developers.

Extensible
  • PHP’s creators built an extensible architecture that enables developers to easily add support for new technologies to the language through modular extensions.
  • This extensibility keeps PHP fresh and always at the cutting edge of new technology.
  • PHP lets you do through its add-on modules: dynamically create image, PDF, and SWF files, connect to IMAP and POP3 servers; interface with MySQL, Oracle.

The Required Tools
  • To put up your dynamic Web site, you need to have access to the following three software

tools:
  • A Web server: The software that delivers your Web pages to the world.
  • PHP: The scripting language that you’ll use to write the programs that provide the dynamic functionality for your Website.
  • MySQL: The RDBMS that will store information for your Web database application. Obtaining PHP For Windows You can easily install PHP from binary files that you can download from the PHP Web site at www.php.net.
  • You can download a Zip file that contains all the necessary files or an installer that you can run to install all the PHP files.
  • To download the Windows Zip file, take these steps:
  • Go to www.php.net/downloads.php.
  • Download the Zip package for the most recent version of PHP

Obtaining All-in-One Installation Kits
  • You can obtain some kits that contain and install PHP, MySQL, and Apache in one procedure.
  • XAMPP is a popular all-in-one installation kit that contains Apache, PHP, and MySQL.
  • It also installs phpMyAdmin, a utility for managing your MySQL databases XAMPP has stable versions available for Windows, including Vista, and for several versions of Linux.
  • XAMPP is available at www.apachefriends.org/en/xampp.html.


Obtaining All-in-One Installation Kits

  • WAMP5 is a popular installation kit for Windows that provides recent versions of Apache 2.2, PHP 5, and MySQL 5.
  • Like XAMPP, WAMP5 also installs the phpMyAdmin utility.
  • The WAMP5 Web site states that it’s compatible with Windows Vista.
  • WAMP5 doesn’t run on Windows 98/Me. WAMP5 is available at www.en.wampserver.com.

How the AMP Pieces Work Together
  • It’s important to understand the role of Apache, MySQL and PHP play in creating your web site.
  • Imagine for a moment that your dynamic web site is like a fancy restaurant.
  • Hungry diners come to your place and each one wants something different and specific. They don’t worry so much about how the food is prepared so long as it looks great and tastes delicious.
  • Unlike a buffet spread where everything is laid out and your patrons just pick and choose from what’ s available, a nice restaurant encourages interaction between the patron and waiter and complete customization of any meal to meet any specific dietary needs.

Characterize the Components of AMP as follows:
  • PHP: Whatever people ask for, your highly trained master of culinary arts, the chef, prepares it without complaint. She is quick, flexible, and able to prepare a multitude of different types of foods. PHP acts in much the same way as it mixes and matches dynamic information to meet the request for fresh web pages.
  • MySQL: Every chef has a well - stocked stockroom of ingredients. In this case, the ingredients used by PHP are records of information stored in MySQL’ s databases.
  • Apache: This is the waiter. He gets requests from the patron and relays them back to the kitchen with specific instructions about how the meal should be prepared. Then he serves the meal once it is complete.

For Further Understanding:
  • When a patron (web site visitor) comes to your restaurant (web site), he or she sits down and orders a meal with specific requirements (requests a particular page or resource), such as a steak served medium well.
  • The waiter (Apache) takes those specific requirements back to the kitchen and passes them off to the chef (PHP).
  • The chef then goes to the stockroom (MySQL) to retrieve the ingredients (data) to prepare the meal and presents the final dish (web page) back to the waiter, who in turn serves it to the patron exactly the way he or she ordered it.


Categories:

0 comments:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!