PHP Menu


Introduction


PHP was an short form for "Hypertext PreProcessor", And PHP was developed by "Rasmus Lerdorf".

In 1995, he developed package called Pesonal Home Page tools which became the first distrbuted version of PHP.


Official Logo

Rasmus Lerdorf

What is PHP

» PHP is an open source, interpreted, object-oriented and server-side scripting language. It is used to create or develop server side web applications.

» PHP is an interpreted language, i.e. there is no need of compilation. And PHP is naturally used for form handling and database access.

» Database access has been a prime focus for PHP development as a result, PHP has driver support for many different database systems.

» PHP is a server-side, XHTML embedded scripting language as such, it is an alternative to CGI (Common Gateway Interface), ASP (Active Server Pages) and JSP (Java Server Pages).

PHP Processing

The PHP processing has two modes of operations

  • Copy mode
  • Interpret mode

In copy mode, the PHP processor finds XHTML code in the input file, it simply copies the XHTML code to output file.

In interpreting mode, the PHP processor encounters PHP script in the input file; it interprets the PHP script and sends the output of the script to the output file.

In simple words, the PHP processor takes a PHP document file as input and produces an XHTML document file as output.

Client-Server model (Request-Response cycle)




In the Clint-Server Model, the client sends a request to the server, then the server receives the request and processes it along with database interactions (if required) and generates the response in the client understandable format, and then the server sends that response to the client.

In the above Client-Server model, the web browser can be used as a client and it understands simple stuff like HTML, JavaScript and CSS, Apache can be used as a server and it translates PHP script into a browser understandable format and MySQL can be used as a database.

PHP Installation

To install PHP, We need to install AMP (Apache, MySQL, and PHP) software pack. It is available for all operating systems and it is an open source.

To work with PHP, we must have a web server (Apache), database (MySQL) and PHP scripting language.


AMP (Apache, MySQL, and PHP) software pack for different operating systems:

  • WAMP for Windows
  • LAMP for Linux
  • MAMP for Mac
  • SAMP for Solaris
  • XAMPP for Cross Platform


In this tutorial, we are going to use XAMPP software pack which is suitable for all operating systems. XAMPP is a AMP software pack which stands for (X)Cross platform, Apache, MySQL, PHP, Perl with some additional administrative tools such as PhpMyAdmin (for database access), FileZilla FTP server, Mercury mail server and JSP Tomcat server.

To install XAMPP on windows

  1. Go to official website of XAMPP i.e. https://www.apachefriends.org/index.html
  2. Click on "XAMPP for windows" as per your windows configuration to download XAMPP pack.
  3. Double click the downloaded file and then click yes to do changes in your operating system.
  4. Select the required components like MySQL, FileZilla ftp server, PHP, phpMyAdmin or leave the default options and click the Next button.
  5. Choose installation directory by default installatin directory is "C:/xampp".
  6. Click the Allow access button to allow the XAMPP modules from the Windows firewall.
  7. After the installation process, click the Finish button of the XAMPP Setup wizard.


To check either XAMPP pack was installed or not

  • Open XAMPP control panel and then start Apache and MySQL servers.
  • Open any web browser and type "localhost" at the address bar as url, then we will get a home page of XAMPP (i.e. Installation was successful)


Next Topic :PHP Program