Installation and first PHP script for beginners

PHP web server database and Operating system

To work with PHP we need a web server. One of the popular web server is Apache. If you are working in windows then IIS is another option you may consider for web server. However Apache works well in windows system.


MySQL or MariaDB can be your choice here. PHP can easily integrate with both the databases.

Integrating all

If we install one by one these products then we need to integrate them all by working in all individual settings . To avoid all these integration process we can select any one of these two packages.

Beginners guide to Installation of XAMPP with Apache PHP MariaDB for learning PHP


WAMP : Windows Apache MySQL PHP
XAMPP : Any Operating system ( X ) , Apache, MariaDB , PHP , Perl

If you are in Windows system then work with WAMP server. XAMPP can be used in any platform.

Using these servers we need not have to integrate our individual systems to get full benefit.

Install any one of these servers in your local system and use it as a development platform before deploying in any production system.

Sample Scripts

Here are some php scripts for beginners to try and practice some simple codes to learn the login and program flow. If you have prior experience of any other programs like C, C++ etc then you can easily understand the program flow and the syntax.

In PHP like any other language there are loops, conditions, functions to manage the script. We will be using these functions or syntax to get our desired output.

First PHP script

Let us start with our first PHP code. Copy the file below to notepad or any other editor and save at root of your localhost or web site as test.php . Then open this page in your server.


Our code is in our local machine so the physical path for it in windows system using XAMPP server is here.
In our browser open this address
If you have created the file first.php inside htdocs then address is here.
The code inside test.php is here.
<title>The first PHP code Hello world</title>
<META NAME="DESCRIPTION" CONTENT="Demo of first PHP code Hello world ">
<META NAME="KEYWORDS" CONTENT="PHP code, sample code, demo PHP"> 


echo "Hello World";


You should get Hello World

First PHP page for Hello world output and checking installation with phpinfo() and uses of comments

PHP codes are case sensitive . Take care that you don't mix lower and upper case syntax.

Every script has two parts, one is about the requirement and the other part is abut the solution. Visitors are requested to first try on their own without visiting the second part for the solution.

Printing all the numbers between 1 to 50
Printing all the even numbers between 1 to 50

Introduction to PHP Printing output by ECHO command

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net



    this tutorial is very good.........


    i am the beginners of php.
    Jaya Devan T


    Its good!!!


    Informative for begginer


    good tutorials

    Post your comments , suggestion , error , requirements etc here

    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2023 All rights reserved worldwide Privacy Policy Disclaimer