Why you’ll learn PHP?
- HTML based site is static and lifeless
Basic HTML pages are simple static pages that only display fixed information with no customization facility. Those are not responsive to user’s action. - PHP brings websites to life
Using PHP, you can add dynamic behavior, interaction between users and website that you see in websites around. Example of dynamic behaviors could be –
- User registration and login
- Website search facility
- Sending feedback to website owner’s email
- Displaying data from database to website and storing data into database
- And, many more
- PHP is the most widely used server-side scripting language
At time of this writing, PHP is the most used server-side language (78.6%) for the websites (Source: http://w3techs.com/technologies/overview/programming_language/all), ASP.NET is in the second position with only 20.3%. The statistics also shows that PHP is the sixth popular of all the programming language. (Source: - Easier to learn and Implement
PHP is easier to learn than its competitors such as like ASP, CGI, and others. It is so easy, that a beginner can learn php write a program within few days. - Free and Platform Independent
PHP is open source, that means PHP is free. You don’t have to worry to purchase license to use it. Also, another great advantage is that same PHP code can be run on different platforms (Windows, Linux, MAC OS X) and you’ll get same output. - Nearly Every Database supports available
One of the greatest features in PHP is its support for a wide range of databases, nearly every databases – MySQL, ORACLE, PostgreSQL, Sybase, Informix to name a few.
What is PHP?
- PHP is a server-side scripting language that means its code is executed on the server.
- PHP was created by Rasmus Lerdorf in 1995.
- Though PHP was originally known as Personal Home Page (PHP Tools), but, with the increase of its usefulness and capabilities, the meaning changed to PHP:Hypertext Preprocessor.
What is the prerequisite to learn PHP?
- If you want to use PHP to create web sites and want to write code for client-side (Click here to know more about Client-side language), then you need to know HTML before learning PHP.
- To write better PHP code, you need to have knowledge in programming – data structure, algorithm.
How PHP pages work over internet?
As PHP is a server-side language, it is executed on the server and the output is sent to the browser that visitors see. When a visitor browses a php-based website, here are the steps that happen:
- Visitor’s web browser sends a request to the web server where the site is hosted
- If the requested web page has PHP extension (for ex. filename.php), the web server forward it to the PHP interpreter that is installed on the web server.
- PHP interpreter gets the PHP file from the hard drive, executes the PHP code. It sends or receives information from database if the PHP script is written to do so. Then it generates output as HTML code and sends it to web server.
AS PHP interpreter handles data before it becomes HTML, therefore, it is called PHP:Hypertext Preprocessor.
- At last, the web server sends the HTML output to the requested browser.
Which softwares do you need to run PHP?
- Most web hosts offer PHP support. So, you don’t need to install any software to run php file. All you need to do is put the php files in the web directory (In the installation lesson you’ll see where web directory is located.).
- In case php is not installed in your host, or you want to run php file in your local PC, you’ll need
- Apache (or IIS) as Web server
- PHP itself, and
- MySQL as database (To store information, database such as MySQL is required.
[Apache, PHP, and MySQL installation will be discussed in the installation chapter.]
Which softwares do you need to write PHP?
You need programming editor or IDE to write PHP. They are designed to speed up development time. There are many free and paid editors available. Choose an editor according to your requirements. Some of the editors and IDEs are mentioned below-
- Free softwares: Among many other, Notepad++ (download link http://notepad-plus-plus.org/) is one great programming editor and NetBeans is one great IDE for Windows system. Beginners can start with this Notepad++. For MAC users, there are TextEdit, TextWrangler etc. Editra is a choice for many web developer and it runs on Windows, MAC OS X, and LINUX, it’s free (http://editra.org ).
- Paid softwares: There are many great paid editors/IDEs for both Windows and MAC OS X. For example, Dreamweaver is a great IDE for Windows, and TextMate is a great editor for MAC (preferred text editor of choice on MAC for many web developers).
What is the difference between editor and IDE?
- Programming editors: Programming editors have features that help to write program faster. Some features include-
- Highlighting syntax
- Showing line numbers
- Opening multiple files at a time
- Providing code library
- Integrated Development Environment (IDE): IDE has support of all the features of programming editor as well as has other options that make an entire development environment. Some extra features that IDE provides include-
- Testing
- Debugging
- Webpage Previewing
- Providing FTP support to upload or download file.
Next Lesson : PHP Installation >> |