Transcript Presentation: PHP
PHP Scripting Language
Introduction
• • • • • “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language.
Originally designed for web development.
Syntax is similar to C, Perl.
Similar languages are Perl, ASP.NET, Ruby, JSP (JavaServer Pages)
PHP Features
• • Performance ▫ Relatively fast for an interpreted language.
Database Connectivity ▫ Support for MySQL, Oracle, dbm, DB2, PostgreSQL ▫ Can connect to any database which provides an ODBC driver (Open Database Connectivity Standard) – e.g. MS Access.
PHP Features
• • Existing Libraries ▫ PHP was originally designed for web use – lots of functions for common web-development tasks (e.g. Sending email, XML parsing, etc.) Portability ▫ Supported on Windows, Mac OS X, other Unix like systems (e.g. Linux).
PHP Features
• • Object-Oriented Programming ▫ Similar syntax and features as C++ and Java – inheritance, attribute visibility (private, protected), abstract classes/methods, constructors and destructors, etc.
Popularity ▫ As a result, lots of documentation, books, and web tutorials.
PHP Usage
• Server-Side Scripting Language ▫ Must have a web server and the PHP interpreter installed.
▫ PHP interpreter processes pages before they are served to clients.
Windows Installation Example
• • Apache HTTP Server Version 2.2
▫ Open-source ▫ Windows, OS X, Unix/Unix-Like (Linux) ▫ Documentation: http://httpd.apache.org/docs/current/ PHP Version 5.3.9
▫ Latest stable version ▫ Installation instructions: http://php.net/manual/en/install.php
Windows Installation Example
• Basic Steps: ▫ Download Apache Win32 Binary from http://httpd.apache.org/download.cgi#apache22 ▫ Install Apache ▫ Download PHP binary installer from http://www.php.net/downloads.php
▫ Install PHP, configured to use the Apache web server ▫ Optionally modify Apache configuration to serve PHP files as directory indices.
Resources
• • Apache ▫ Website: http://httpd.apache.org/ ▫ Documentation: http://httpd.apache.org/docs/2.2/ PHP ▫ Website: http://www.php.net/ ▫ Documentation and language reference: http://www.php.net/docs.php
Resources
• Xampp ▫ ▫ Combines an Apache web server, PHP, and MySQL into one simple installation service. ▫ Very little configuration required by the user to get an initial system up and running.
http://www.apachefriends.org/en/xampp.html