PHP - History & Application |
Article is yet to be rated |
|
| Author:
| Icydemon
|
|
| Submitted: |
01-Jan-1970 01:00:00 |
| Imported From: |
zZine (original author: Icydemon)
|
| PHP has a great history over the past few years. First, it begun as a project, named PHP/FI (which stood for Personal Home Page / Forms Interpreted), created by Rasmus Lerdorf in 1995. PHP/FI initially was a simple set of Perl scripts.
|
|
As he needed more functionality, Rasmus wrote a C implementation, which could communicate with databases, and enabled users to develop dynamic web applications. Rasmus released the source of PHP/FI, so anybody could take a look on it, add more features of fix bugs.
In 1997 PHP/FI 2.0, the second version of the C implementation had approximately 50,000 domains using it, which reported that they had installed PHP. This number is equal to 1% of the domains which were on internet back then. Many people contributed to PHP/FI but still, it was a one-mans-project.
PHP/FI 2.0 was released on Late 1997. Two university students then Andi Gutmans and Zeev Suraski, wanted to write a e-commerce site, which was an university project. They found it "severely underpowered" on this field so they began writing a new version of, then renamed, PHP along with Rasmus. The result was PHP 3.0 which had strong flexibility features, supported many different kinds of databases, and many APIs. PHP 3.0 attracted many developers, who joined the project and gave new extension modules to it. Other features like, Object Oriented Programming support, and the much more powerful language syntax were included. PHP 3.0 was released in Mid 1998, after having spend many months on public testing. By the end of 1998, approximately the 10% of the Internet Domains then, were reported that they are using PHP.
By the winter of 1999, Anti Gutmans and Zeev Suraski had begun working on a complete rewrite on PHP's core. Their goals were to improve performance of complex applications and the modularity of PHP's code base. The new engine which was created named "Zend Engine" (a word play of their first names Andi & Zeev), met the goals successfully. PHP 4.0 introduced officially in May 2000, two years after PHP 3.0. In addition to the highly improved performance, PHP 4.0 included other features such as support for many Web Servers, HTTP sessions, more secure ways of handling user input and many more.
Today PHP is being used by hundredths of thousands of developers, and several million sites report as having it installed.
PHP 5.0 is the next step, which will be mainly based on its core, Zend Engine 2.0, which currently is in a beta stage.
Installation of PHP on Apache 1.3.x (Windows)
The most common installation is PHP & Apache 1.3.x on Windows. Assuming that you have installed an Apache Web server, and you want to install PHP 4.0 Support. There are two ways to install it. The one is to use the CGI binary (php.exe).
Simply shut down Apache (if Apache runs as a service run NET STOP APACHE, otherwise press Control + C on the Apache window). Open the httpd.conf file which can be found in the conf directory of Apache, and append the following lines to your configuration (add what is written in italic):
- ScriptAlias /php/ "c:/php/"
- AddType application/x-httpd-php .php
- For PHP 4 add Action application/x-httpd-php "/php/php.exe"
- For PHP 5 add Action application/x-httpd-php "/php/php-cgi.exe"
- To specify the directory where php.ini is add SetEnv PHPRC C:/php
The other installation type is to use the Apache module DLL. In that case you have to:
- AddType application/x-httpd-php .php
- For PHP 4 add LoadModule php4_module "c:/php/sapi/php4apache.dll"
- For PHP 5 add LoadModule php5_module "c:/php/php5apache.dll"
- To specify the directory where php.ini is add SetEnv PHPRC C:/php
Advanced users can do many more things on the configuration. Now if you configured this correctly, you need to modify
PHP.ini which is on the folder you installed PHP (e.g. C:\\php). there are 2 files there: php.ini-recommended and
php.ini-dist. Both of them are well commented and they will help you configurating PHP. Finally start Apache again (NET START APACHE if it is a service, otherwise start it manually) and if you installed PHP correctly you will see something like:
Apache/1.3.33 (Win32) PHP/4.3.10 running...
This the simple installation progress which works for me and for the most systems I installed Apache & PHP on them. If you encounter any problems while installing PHP, or for any other reason you cant make it work with Apache, I advise you to
check the install.txt file which is found on the installation directory of PHP. It is very descriptive and I am sure that consulting it, will solve your problems
Applications
Well, here we come to the interesting part. PHP can do many spectacular things from a simple number calculator, up to forums, e-commerce sites, and generally dynamic and interactive sites which provide the user with flexibility and interactivity. You probably have seen the forums of many sites which are based on PHP, some of these are PHPbb, vBulletin and many more. PHP can do some spectacular things, if the developer is creative and has a project in his mind.
I'd like to begin with forums. A forum typically is a user interface for communication with other users but not in real time. The Idea is simple. A user makes a post, another user makes a reply on the post and so on. There are forums out there which providing from the simple posting and replying features, upto public profiles, statistics, avatars, private messages, and many more. Some day, while on conversation with someone on IRC, he told me that he would like to create a forum and he wanted directions. It was a nice idea. And I started to implement it. After 5 days and 60 Kilobytes of code i had a fully working forum.
Long story short, PHP is very good for creating forums, because it supports many database servers (MySQL, MSQL, Microsoft SQL, dBase, and many more), it is easy in writing, if compared to Perl, and it's free and open source (compared to ASP). It is the perfect language for someone who begins to mess up with interactive websites.
PHP can also be used to create an e-commerce site. The general idea is this: A user sees your products, selects one or more he wants to buy, and places his order. PHP can give you a file with the user's order, your staff process it and you send that to user. And not only this. PHP can work with organizations like PayPal, so to perform online transactions in real time. This speeds up the whole process of buying and selling items and services through internet. Finally, there are Web Based PHP Games out there. Games who are Massively Multiplayer and are played in real time. What about having your own fleet of starships and fighting in space with your friends? PHP Games (such as Blacknova Traders) are popular and played by people. Why in PHP? We said it before that it's free and more easy than other scripting languages. So developers choose PHP for that (and many more reasons).
PHP has a lot of Applications. Just let your imagination travel and PHP will do it as currently it has functions (therefore support) for over 120 different things. Examples: MySQL, mSQL, Microsoft SQL, dBase, Apache Functions. zLib, Bzip functions, HTTP Functions, Mail Functions and a lot more.
The Language
PHP is a c-style language. Every statement ends with a semi-colon (;). Variables begin with a dollar sign($) and you will find that is very similar to C. For example, you can increase a variable by one using the 'C' method: $var++; Compared to C, you dont need to include anything because all functions which are supported/featured on PHP (such as MySQL functions), work without including a file (but to have some Input/Output work with C you need to include stdio.h). Someone said that PHP is for web what Visual Basic is for Applications Development. Anyone can learn it in a week and he/she can do a webpage or site in no time. HTML/CSS create the friendly user environment, PHP creates the interactivity between the webpage and the user. A common thing which is used with PHP is databases. When you are serious on doing a PHP site you will definitely need a Database to hold records of users (personalized sites like forums), user's movements and orders (e-commerce sites), etc. PHP does the transaction between the user and the database and prints the data in the page. What does this do? Simply, when you go to a forum you have to "log in" in most cases. You type your name and your password there and you press the Submit button.
Developers will have php handle the data, but the main idea is this:
After user submitted his information, open a link to database, and check if the user exist. If yes fetch his/hers password from the database and compare it with the given one. If the password is correct proceed and log the user in. If the password is not correct, display a message to the user. So simple Databases just add interactivity to the user. The alternative to databases are files, stored into the server machine. But this method (of storing data into files), is less secure and more time-consuming when you have to access/read/write the files. ASP & Perl which are also used by many sites can do that job. Developers use PHP because it's free, platform independent and easy.
Conclusion
It is a fact that many sites (estimated to 20% of web domains) are using PHP. It is a fact that PHP is the fastest growing language. A summary what PHPs pros and cons:
- Easier to learn. Easier to Develop
- Platform Independent like Perl (ASP can run only on Windows)
- Supports many functions
- Slower than other Programming Languages
- Not so powerful compared to other Programming Languages
If you want to start developing interactive sites, get a web server, get PHP from http://www.php.net, and a simple text editor. There are free IDEs there to help you on development, and a bunch of tools, most of them freeware to extend your site. Forums, Games, Pre-Made Site, etc. But the final choice is yours.
Sources: PHP Manual, PHP.net website.
This article was originally published by CyberArmy.net in the CyberArmy Library.
|
|
You must be logged in to vote on an article
|
About Us | Privacy Policy | Mission Statement | Help
|