02 - Requirements for PHP


PHP is used as server side scripting most popularly nowadays. For the installation and deployment of PHP some pre requisites must be followed:

Linux, Apache, MySql and PHP. These all four terms are to be considered as LAMP stack. While this stack is used on Linux operating system, it is known as LAMP, when using on Windows operating system (WAMP), using on Macintosh operating system (MAMP) and if used on Solaris platform is known as SAMP.

Operating system:

PHP run on various operating systems including Linux, windows etc, Linux is the most widely operating system for PHP development. The main reason behind this is: Linux is also open source operating system. Open source refers to a program whose source code is made available to users for modification or configuration according to the requirements of users. In this way software can be intended for free sharing, improvement for developmen

The open source software can be distributed to anyone without any restriction. The license can require improved versions of the software.

Web server

For PHP deployment, we can use Apache or IIS as web server. Apache is the most widely used web server. The latest version of apache is 2.4.10

Apache is also used as open source web server. It is compatible with number of operating systems including linux, windows, solaris etc.

Role of apache in website development using PHP

Web server is basically responsible to accept requests from clients and send responses to those requests. Web server receives a URL from client machine, converts this URL in its corresponding static request and sends the output of that request back to the client’s browser.

Apache can be freely downloaded and install.

It’s code is available and can be modified also. Apache is capable to handle small to large websites. It supports static and dynamic both type of contents.

The source code of apache can be optimized and security holes can also be fixed. Apache HTTP server supports multi-tasking.

Developers can also add their own code module to apache that will extend the server’s capability. To add a new module to apache, we just install it and restart the apache web server.

Apache server offers wide variety of services, those can be used through various protocols, different ports, like port 80 is used typically by apache, for SMTP it uses port 25, for DNS it uses 53 port and for FTP it uses port 21.

Apache is based on TCP/IP protocol suite. Apache’s configuration file is HTTPd.conf.

Apache has four main directories in its overall structure.

Htdocs: It is default document directory. It contains all static pages and dynamic contents those can be accessed through HTTP.

    Conf: This directory is the configuration directory, where all configuration files are stored. Each directory is placed on a separate line and has a # symbol that indicates comments.

    Logs: It is the directory where all server logs are stored including apache access logs and error logs

Cgi-binThis is the directory where CGI scripts are stored.  CGU scripts are programs or shell scripts those are written to be executed by apache.


Any Database is the backbone of any website, where we can store the complete data about logically related entities. When we use PHP scripting language, Mysql can be used as the most popularly relational database. It is developed and distributed by Oracle Corporation.

MySql is relational database that means it stores the data in various separate tables and it can be fetched when required optimally. For this all the tables are linked with each other using various relationships (one to one, one to many and many to many)

Like all other database MySql also uses SQL (structured query language) to access databases.


PHP stands for Hypertext Preprocessor, it is widely used server side scripting language that can be embedded into HTML. PHP is different from java script code (that is executed on client side).

For the execution of PHP code it is mandatory that our server supports and configured for .php files.

Client side scripting is mainly used for dynamic animations, validation forms on client side only. On the other hand PHP can be used for most of the other useful aspects of web sites such as:

  • Content sites (both in production and development mode)
  • For community features (forums, bulletin boards etc.)
  • Emails (web mails, mail forwarding etc)
  • Customer and technical support systems
  • Advertising networks
  • Business applications
  • Surveys, polls and online tests
  • Form submission
  • Groupware
  • Catalog, brochure and informational sites
  • games

PHP scripts can be executed more fastly as compared to other server side scripting languages. Using PHP we can create customize and interactive web pages using PHP. Most of the E-commerce website are developing today using PHP.

Like us on Facebook