PHP Introduction And Enviornment Setup – Info PHP
To learn PHP we should read this boring theory but next tutorials are very interesting .
PHP (Preprocessor Hypertext) is a server side scripting language. It is free to use and open source. Pages code is written in PHP, compiled and executed on the server side but pages are visible to client as an HTML page, but the client is not able to see the source code of the page. With the help of PHP we can make the web page dynamic. Dynamic means page, according to user like the Facebook when we open Facebook and enter the username and password then we see only the information of us, this is a dynamic web page.
To understand this we take an example of the Facebook. The client has the web browser and he request for the web page of Facebook by entering the URL facebook.com. Then Facebook provide login page, when user enters his/her username and password then the server checks the username and password is correct or not which is saved in database of the Facebook. If it is correct then the page of client is opened otherwise it generates an error. When the user open his/her Facebook ID, then he/she can see the timeline, photos, etc. He/She can update status, upload anything, etc.
So this is the working of Facebook but what are the things that the PHP Application did in this:
- Firstly, PHP Application provides the login page in an HTML web page.
- Checks for username and password with the help of the database of Facebook.
- If the password and username is correct, then PHP Application open the users page, otherwise generates error.
- All uploads of all the user saved in the database of Facebook, but PHP only provide the data which user want.
There are many tasks that a PHP Application did:
- About PHP File
- Powers of PHP
PHP can generate dynamic page content. PHP can create, open, read, write, delete, and close files on the server. It can collect form data. PHP can send and receive cookies and it can add, delete, and modify data in your database. PHP can be used to control user-access & authentication. It can encrypt data.
- Reasons of using PHP
PHP runs on various platforms (Windows, Linux, UNIX, Mac OS X, etc.). PHP is compatible with almost all servers used today (Apache, IIS, etc.). PHP supports a wide range of databases and is free. Download it from the official PHP resource: www.php.net. It is easy to learn and runs efficiently on the server side.
Environment Setup for PHP
To use PHP, we need a web host with PHP support. Now you just create some .php file and save this on your web directory, the web host server will automatically parse them and then a user can access this web page, there is no need to compile using extra tools for making it run. PHP is free and most of the web hosts supports the PHP.
So we can use your system as a web server, to do this we need some software:
- Install a web server
- Install PHP
- Install a database, such as MySQL
This is very boring to install all software partially and use it partially, instead, we can use xampp. There is only one software that need to install in the system that provide a GUI control panel.
To install xampp here are the steps:
- Open the URL.
- Click download (Available for Linux and MAC os & 32 bit and 64 bit ).
- After downloading, open the installation package.
- Follow the steps (you know how to install software).
The next thing we want an editing software like notepad. Here, I will suggest to use notepad++. To install it the steps are:
- Open the URL.
- Click on the link which is in marked red here. Notepad ++ is downloaded in your computer.
- Then install it, you know well how to install software no extra things are to be done.
We use notepad++ to write our code. And it is a very user friendly editor.
The theory is not fully discussed but enough to start I will tell you about the theory when it needed in programming.
So these are the boring stuff of all programming languages.
Now we start with some coding.
Article Prepared by Ollala Corp