Your Virtual Knowledge Campus

How To Instal PHP & PHP Syntax

php install and php syntextTo do work with PHP first of all you have toInstal PHP   .if you have no server supports PHP. But If your  server supports PHP then you have no need to do anything.

Just create a PHP file Like:  example.php in htdocs or in your web directory then save and finally write on browser:http://localhost/eexample.php then Go.

If you have no server supports PHP you have to  Instal PHP first  . you can Instal PHP From

the several following links:

How to install PHP5 from :

  Free download PHP

form here:

Free download Apache

form  here:

 free download MySQL

form   here:

PHP Coding Syntax:

PHP script all time  starts with <?php and ends with  ?>.

and PHP script can be placed anywhere in the document.

Basic  PHP Syntax:


Content have to write here.

 .php extension  must have in  a PHP file.

PHP file generally  contains HTML tags  and some PHP scripting code.

Example of PHP code:




echo “Well come to PHP Tutorials”;




Normally two basic   statements are used to show the output text in PHP:

1. echo and

2. print.

In the above  example we have used the echo statement to  show the output the text “Well come to PHP Tutorials“. rather than print.

Every statement or  code line in PHP must end with a semicolon.

 PHP Comments:

In PHP generally we use // symbol to denote  a one-line comment and

/* and */  symbol to make a block comment :

For Example:


//This is  a single-line  comment

This is
a comment



Related Post: © 2017