PHP

Greenland native Rasmus Lerdorf was tired of writing the same code over and over while creating his personal dwelling house page back in 1995.

And so, he says, he wrote "a very simple parser" to replace tags in an HTML file with some lawmaking he'd written in C.

That project evolved into PHP, an open-source scripting language now installed at more than than one in every five Spider web domains, according to an October 2001 survey of more than than 6 million domains conducted past Netcraft, a Bath, England-based Internet consulting visitor.

More than

Computerworld
QuickStudies
PHP fans say the language is uncommonly easy to larn. Information technology has a lot of built-in functions such as simple connections to databases and back up for the Lightweight Directory Access Protocol (LDAP).

"PHP was developed from the footing upwardly to be a Web platform," says Zeev Suraski, chief technical officer at Zend Technologies Ltd. in Israel and an writer of the current version of PHP. "Very powerful applications can be created in a very short time. . . This is the No. 1 feedback I get from people."

PHP code is highly portable; it moves from one make of server to some other with minimal or no rewrites. This multiplatform support appeals to It managers who don't want to exist locked into a single brand.

Free and Easy

Every bit open-source software, PHP is free for corporate utilize and works well with other pop open-source projects, including the Apache Web server and the MySQL and PostgreSQL databases.

"If we didn't take PHP, it would cost united states of america six to vii times as much to operate [our] IT environment," says Kevin Crothers, head of corporate Spider web systems at WorldCom Inc. WorldCom has used PHP for several major Web projects, both internal and external, including the forepart end to a searchable database of employees and contractors that contains more than than 100,000 records. "Information technology's all LDAP-based," he says, noting that PHP had "the strongest LDAP integration we've been able to detect."

PHP uses server resource efficiently, Crothers says. Information technology uses memory sparingly and allows customer-side interpretation of code to shoulder some processing burden.

"There'southward money in your pocket correct at that place," he says, because a PHP-based awarding requires less server hardware than some other environments. Crothers adds that he has establish PHP to be both stable and secure, and he believes that the language is very piece of cake to learn compared with competing technologies such as Microsoft Corp.'s Agile Server Pages (ASP) engineering for dynamic Spider web applications.

Room for Comeback

Nevertheless, many developers generate ASP lawmaking from software such every bit Microsoft's Visual InterDev, which tin be easier for nonprogrammers than coding in PHP, Suraski notes.

At present, there are no loftier-level commercial WYSIWYG Web authoring tools that automatically generate PHP pages, which means you need actual programming knowledge. That doesn't appeal to every Web development store, but Suraski says he believes some PHP authoring tools will exist out later this twelvemonth.

He also acknowledges that PHP's object-oriented programming capability, compared with that of Java, for example, "is not as powerful as information technology should be." This can make PHP a bit more cumbersome for creating very big-scale applications. However, improvements are in the works for PHP Version 5.0, he said, which is due sometime in the 2nd quarter.

Lerdorf says other upcoming improvements include making PHP Extension and Awarding Repository (PEAR) more useful. PEAR solves some Spider web-related problems but isn't part of PHP itself. "You will also see some dainty ways to build [Simple Object Access Protocol/Web Services Clarification Language] services with PHP," he says.

PHP is an interpreted language and doesn't use compiled binary executables, so PHP applications can exist more easily viewed and dissected by competitors, says Crothers. For hiding lawmaking or creating applications for resale, products such equally Zend's Encoder volition mask some work.

For professional-level quality assurance and testing, Crothers advocates using a product such as Komodo from Vancouver, British Columbia-based ActiveState Corp. Komodo's integrated development surroundings is available free to individuals and nonprofit organizations.

Ultimately, Crothers says, PHP is an excellent surroundings for creating Spider web applications for WorldCom. "Information technology does everything," he says.

Higher up is an example of simple PHP lawmaking for e-mailing data entered into an HTML class, where the form has fields called comments (for comments entered by a user) and frommail (for a user-entered e-mail accost), as well every bit a hidden field tomail (for the address where information should exist sent). The e-postal service would be sent with the field of study line "User Comments."

In a production surround, boosted code would be added for validation and security.

Encounter additional Computerworld QuickStudies

Copyright © 2002 IDG Communications, Inc.