PHP : Basics, Uses, Program

0




What is PHP?

PHP This is an open-source server-side scripting language used to create web applications.

PHP language is embedded in HTML or HTML5 in this scripting language.

PHP's full-form was called Personal Home Page in the past but currently it is called HyperText Proprocessor.

PHP language was invented by Rasmus Lerdorf in 1994.

PHP being server-side, it is run on the web server or client machine.

If PHP has to run then some client machine server is required like, Xampp, Wamp, Lamp and many more servers.


Use of php :

PHP is used in web application.

Many databases are used with PHP like MySQL, SQL, Oracle, PostegreSQL etc.

There are many frameworks for PHP.

Files are open, closed, read and written in PHP.

Cookies are set and accessed.

The value of the variable of a webpage can be accessed on any webpage from the session.

Files or emails are sent to anyone.

If the programmer knows C language well then it becomes easy to learn PHP because syntax of C language and syntax of PHP is same.

The code of one PHP is included in the code of another PHP.

PHP provides privacy to its pages.

PHP is used on all operating systems like Windows, Linux, Mac OS etc.


Run PHP on Local Computer :

There is a very easy way to run PHP code. Some softwares have been made to run PHP, out of which three are the most used softwares.

Using Wamp(Windows)

Using Xampp(Windows, Linux, OS X)

Using Lamp(Linux)


1. Using WAMP(Windows/Apache/MySQL/PHP)

Step 1: First go to this website www.wampserver.com/en and download the wamp server.

Step 2: After downloading it, install it on your local computer.

Step 3 : Installed wampserver will start by doing start->All programs->Wamp server->Start wamp server

Step 4: After that, to check whether Wampserver has started or not, go to any of your browsers and enter http://localhost or http://127.0.0.1 on the URL. If the page of PHP Configuration comes then the server has started.

Step 5: After that the directory on which Wamp server is installed. On that directory 'wamp/www' create your php page on this directory.

Step 6: Suppose the name of PHP file is 'wamp/www' root on hello.php like this, then on browser enter http://localhost/hello.php like this. This will run PHP.


Using XAMPP (X-Cross-Platform, A-Apache, M-MariaDB, P-PHP, P-Perl) :

Step 1: First go to this website https://www.apachefriends.org/download.html and choose your operating system and download XAMPP.

Step 2: After downloading it, install it on your local computer.

Step 3: The shortcut for XAMPP installed will be available. Start Apache by clicking on it, if you have connected to the PHP Page database, then start MySQL as well.

Step 4: To check, go to the browser and go to http://localhost/, this will show whether the XAMPP server is started or not.

Step 5: After that a folder named xampp/htdocs will be created on the directory where XAMPP is installed.

Step 6: Suppose the name of the PHP file is 'xampp/htdocs' on the root as hello.php then on the browser enter http://localhost/hello.php like this. This will run PHP.


Basic PHP Program :



<!DOCTYPE html>
<html>
<body>

<h1>My first PHP page</h1>

<?php
echo "Hello World!";
?>

</body>
</html>


Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !