PHP Installation

PHP is a scripting language that provides the ability to implement logic in web pages. Like any other programming language, PHP also provides object oriented programming features. Therefore, to execute PHP scripts, you need a PHP interpreter.

  • The Apache Web server
  • The PHP engine
  • The MySQL database server

Because PHP is a server side scripting language, a server is also required to execute PHP scripts. PHP scripts can not be executed without the server. Apache is the most common server to use for learning development in PHP.

If you are creating a database application (for storing data) then you also need a DBMS such as MySQL.

If you want to configure PHP, MySQL and Apache server, you can configure it separately. But you do not have to do this. XAMPP package has been provided by Apache Friends for easy development in PHP.

What is XAMPP ?

XAMPP is a free, open source web server solution package. It has been developed by Apache Friends. There is mainly Apache HTTP Server, MySQL Database and PHP interpreter files available. XAMPP is a cross platform package. It is available for all major platforms.

After installing XAMPP, you do not need to install any other software. This is a complete package for PHP development. When you install XAMPP, your computer automatically installs other services such as PHP, Apache Server and MySQL.

Download XAMPP

Creating Your First PHP Program

PHP is a very simple scripting language. If you have read C language then you can easily create web applications in PHP. So far, you have learned about PHP tags. Let’s now try to make a simplest program in PHP and understand it.

However PHP can be embedded with HTML. But you can also create a program of only PHP. The following is a pure PHP program.

echo "Hello";
echo "Welcome to Coding Bot";

The <?php opening tag has been used first in the above program. As you know, the PHP code is always written between <?php and ?> Tags. Therefore it is necessary to define these tags before writing the main PHP code.

This is a very simple example, this example prints Hello and Welcome to Coding Bot messages as an output.

PHP Program with HTML

<!DOCTYPE html>
  <title>PHP Program</title>
echo "Hello"; 
echo "Welcome to Coding Bot";