Hello readers, This is Rahull singh going to introduce you about PHP. Before starting it we need to know, actually what is PHP ..??
What is PHP ?
The very first thing which is taught is the full form of any language.
- PHP stands for Hypertext Preprocessor. (earlier known as Personal Home Page)
- PHP is a web designing language which is used to develop websites.
- It is server side scripting language.
- It is open source, means you are free to download it from website. No need to pay any cost to anyone to download it.
- It is used to generate dynamic web pages.
Why to learn php ?
- It is easy to learn.
- It is platform independent. (i.e. runs on different operating system)
- It consumes less time to develop website
- Many job opportunity in the field of web development.
- Creates a wide variety of websites. (such as: Ecommerce, personal website, blogs, entertainment e.t.c)
- It supports different types of databases.
Things to know before learning PHP.
I hope you have basic knowledge of HTML & CSS. If you don’t have then first learn basics of HTML & CSS.PHP language is very popular in web development since a long time ago. Since the biggest social networking site Facebook is also developed on PHP.
PHP language is used in
- Millions of other websites running on php.
How to start working on php
Since you learned that php is a server side scripting language. It means that php programs will run only on server not on your computer. But don’t worry i am here to help you out from this problem. There are some softwares which will help you to build your system as server. Sounds good….!!
Download any of them from (xamp, wamp, lamp..). I will prefer XAMP because i use it. It will give your computer as a server environment where you can run your php programs.
- XAMP, WAMP, LAMP, and many more..
- NOTEPAD++ for writing the program.
Installation of Xamp server
Step-1. Download xamp server from https://www.apachefriends.org/index.html (Choose your operating system).
Step-2. Select language and press ok.
Step-3. Simply click OK, and move forward to next step.
Step-4. Click next
Step-5. Check all the checkbox and Click Next
Step-6. This dialog box will give you the freedom to save your xamp-server directory in any location. Click install to move next step.
Step-7. Installation begins.
Step-8. Final step of installation. Click finish.
We have completed all these steps of installation. Let us confirm the successful installation of xamp server.
Open Xamp control panel and start it as illustrated in image below:
As, of now we have to start only APACHE & PHPMYADMIN. Confirm that both apache and phpmyadmin has started. if both of them shows stop after clicking on start button, then everything is all right. If one of them not starting then please comment below i will solve it very soon. This problem occurs due to PORT issue. By default xamp acquires PORT: 80. In case any other software is using this port then you have to change the port of xamp server.
Open the drive where you have installed the xamp server. By default it is installed in Drive C:
Open Xamp directory (C:/xampp/htdocs/). Create a new folder, name it php (you may use any name of folder)
Open notepad++ (or any text editor), and be ready to write your first program of HELLO PHP.
echo "Hello Php";
- Each php program starts with <?php and end with ?> be careful (you may commit mistakes by doing “<?” during end the program.).
- Save the program name with .php extenstion (e.g hello.php).
- open your web browser(e.g Chrome, mozilla ) and type in url: localhost/php/hello.php and hit enter.
- To print any thing in php we use echo command. Just try it by yourself. Since you may know “Practice makes a man perfect.”