Jump to content

  • Log in with Facebook Log in with Twitter Log In with Steam Log In with Google Sign In
  • Create Account

Tutorial info

  • Added on: Feb 23 2013 03:04 AM
  • Date Updated: Feb 23 2013 03:31 AM
  • Views: 380
 


PHP

What Is PHP? How PHP Started? Why PHP Is Popular? The Pitfalls of Using PHP? Learning PHP

Posted by Jopa on Feb 23 2013 03:04 AM
php
What Is PHP?

PHP stands for Hypertext Preprocessor, and it's used for server-side scripting in order to come up with dynamic Web pages. PHP is basically a general-purpose script language and is usually embedded into HTML :
Hypertext Markup Language (HTML)


Definition - What does Hypertext Markup Language (HTML) mean?

Hypertext markup language (HTML) is the major markup language used to display Web pages on the Internet. In other words, Web pages are composed of HTML, which is used to display text, images or other resources through a Web browser.
All HTML is plain text, meaning it is not compiled and may be read by humans. The file extension for an HTML file is .htm or .html.

HTML was never designed for the Web that exists today, as it is just a markup language with severe limitations, in terms of control and design. Numerous technologies have been used to work around this issue - the most significant being cascading style sheet (CSS).
The long term solution is (or hopefully will be) HTML5, which is the next generation of HTML and allows for more control and interactivity. As with any development on the Web, the move to standards is a slow and arduous process, and Web developers and designers have to make due with current and supported technologies, which means that basic HTML will continue to be used for some time.

Because it's a server-side language, it is not executed on the user's computer but on the computer or server from which the Web page is being requested. Take note, however, that the server does not naturally understand PHP. It must be configured to detect PHP segments in a .php file, get the entire HTML arranged, and send it to the user. In fact, PHP is executed first, before any of the HTML itself is run. :)


How PHP Started

PHP has been around longer than you might imagine. In fact, it was first introduced in 1995 by Rasmus Ledorf, who wrote the initial scripts to help him manage his own website. Since then, the simple scripting language based on Common Gateway Interface
binaries in C evolved to how we know it today. Now, PHP is the most known and most used scripting language.

What does Common Gateway Interface (CGI) mean?

Common Gateway Interface (CGI), in the the context of web development, is an interface for running executables via a web-server. In most intances, this means taking an HTTP request and passing it to an application in order to deliver a dynamically-generated HTML page back to a browser. While pretty much any program that can run on a web server is usable as a CGI script, Perl is the most popular language.

The standard for CGI is defined in RFC 3875.

The most common usage of CGI is using scripting languages, and so it's common to refer to this as running a CGI script. CGI programs and scripts are usually collected in a folder named /cgi-bin/.

The main disadvantage of CGI is that each page load incurs overhead by having to load the programs into memory. Data cannot easily be cached in memory between page loads. Because of this disadvantage, many developers have moved to application servers that remain running. However, there is a huge existing code base, much of it in Perl. Proponents of CGI argue that it is simple, stable, and a good choice for certain applications, especially involving tasks where Perl excels, such has text handling. Workarounds also avoid loading in the Perl or PHP runtime for each request by including the runtime in the web server (mod_perl and mod_php in Apache), or other solutions such as FastCGI (separate processes that handle multiple requests).

Why PHP Is Popular

Aside from being the most widely used scripting language in the world at present, there are other reasons why PHP is something that you should learn.

First, PHP is open source:
What does Open Source mean?

Open source is a philosophy that promotes the free access and distribution of an end product, usually software or a program, although it may extend to the implementation and design of other objects. The term open source gained traction with the growth of the Internet because of the need to rework massive amounts of program source code. When source code is opened to the public it allows for the creation of different communication paths and interactive technical communities; it also leads to a diverse array of new models.

PHP can also be used in many platforms and is compatible with many servers. PHP scripts may be executed on a computer that runs on Windows and will have no problems when it is run on a Unix or Linux machine. What's more, PHP runs on many of the most popular servers today, such as IIS and Apache. PHP also works seamlessly with most of the popular database servers such as Hyperweave, Sybase, Oracle, MySQL, FrontBase, Ingres and Informix.

Last but not least, PHP is very flexible. Gone are the days when PHP was seen as a series of sloppy lines of code more suited for use by hobbyists than professional Web developers or webmasters. Nowadays, PHP is seen as a very flexible Web development language that may be used to create traditional desktop applications, batch processing programs and Web applications. This is because PHP is rather easy to use and very simple to understand. In fact, it's quite possible to learn PHP even without prior programming experience and knowledge.

enjoy it :)