An IT Manager's Take on PHP

An IT Manager's Take on PHP


September 7, 2000

While the success of open source software like Linux or Apache has been documented extensively throughout all mainstream media, the rise of PHP has gone largely unnoticed. Still, thesWeb scripting language PHP is the most popular module for the Apache Web server, according to a E-Soft survey (http://www.e-softinc.com/survey/). Netcraft studies have found that PHP is in use on more than 6 percent of all Web domains in the world (see http://www.netcraft.com/survey). That is an incredible market penetration for a rather specialized product. And its popularity continues to rise exponentially, with the recent release of version 4.0.

s

Increasingly, PHP's popularity is being reflected in traditional media: By May 2000, more than 20 books about PHP had been published in different languages, with more in the pipeline. Commercial players are beginning to join the bandwagon: PHP is included with Web servers, (e.g., C2's Stronghold) and Linux distributions. A new company, Zend Technologies,shas been formed to provide commercial add-ons and support for PHP.sA long list of large-scale Web sites employ PHP, as do hundreds of thousands small to medium Web sites.

s

Which are more than enough reasons to take a closer look at PHP.

By Tobias Ratschiller

s

Traditionally, developers have used CGI (Common Gateway Interface) scripts for interaction with users, querying databases, and so forth. However, because CGI scripts are separate software programs that get executed as stand-alone processes whenever a user requests the script, scalability is lacking - CGI scripts could quickly consume all available memory and CPU power.

s

Enter PHP: Rasmus Lerdorf, a then Toronto-based IT-consultant, developed it in late 1994 as a quick hack to embed macros into HTML pages, to avoid the forking of external programs. When he decided to make his project open source, it proved to be popular, and users started to contribute to it. In 1997, Zeev Suraski and Andi Gutmans, two developers from Israel, rewrote the core engine of PHP, the language parser, and made a complete programming language out of a pet project. The current rewrite, PHP 4.0, is again much cleaner, especially with complex scripts and when used in business environments.

s

Welcome to the World of PHP provides a more comprehensive introductory overview of PHP.

By Tobias Ratschiller

s

PHP scripts are often embedded in the HTML code of page, and then get parsed on the server-side - the browser seessonly plain HTML. Thus, a typical Hello-World script looks like this:

s

<html>s<? print("Hello World!");?> </html>
s

This is the method that novice developers find theseasiest to work with. Larger and more complex applications usually gosother routes, to enforce a cleaner separation of layout andsapplication logic. When embedding the script directly in HTML,saverage, HTML-literate Web designers cannot easily edit the contentssof the page without being familiar with the scripting language used.sPHP offers a variety of libraries to work with page templates, whichssolves this problem and introduces an efficient development methodologysand simplify maintenance. This way, developers focus on thesapplication logic, and designers can change the layout of a dynamicspage without involving the developer or interfering with the programslogic. This translates into faster application development, and makessmaintenance tasks easier by dividing them into content and logicstasks, which can then be handled by separate team members.s

s

PHP needs not be used for Web development exclusively. It can also be compiled as a stand-alone script interpreter, and it handles simple system administration tasks as well. For example,sdaily statistics can be sent from an e-commerce application using a small PHP script. In version 4.0, the language core engine, the Zend parser, has been abstracted enough to be embeddable in other technologies. Rumors has it that it is planned to integrate PHP as stored procedure language into the popular MySQL database system. Seeing the dynamic evolution of PHP, it is only logical to expect the language to grow into other scenarios - why not use PHP as a macro processor in a word processor?

By Tobias Ratschiller

s

Weswill now discuss how PHP meets these challenges.

s

The first advantage of PHP is one common to many Open Source projects: Itsdelivered, while other technologies were still "vaporware." PHP pre-dates ASP, Mod_Perl, and ColdFusion by at least 12 months. Over the years, PHP had the opportunity to strengthen its core base and to integrate more features. Today, it provides a base that can easily stand out in the increasingly crowded server-side application development platform market, as the following points will show.

By Tobias Ratschiller

s

Perl is a general scripting language; Java is a full-fledged, complex programming language; Visual Basic Script and JSscript havesbeen post-integrated into ASP. PHP, however, was built with the needs of Web developers in mind. In Web application development, there is no itch PHP cannot scratch. Unlike other cumbersome, overhead-laden approaches, PHP is lightweight and focused on the Web - where it can solve complex problem scenarios quicker and more easily than comparable technologies.

s

The syntax and grammatical structure of PHP resembles the C programming language with the complexity (e.g., memory management, pointers, and strong typing) taken out. The developers of PHP aren't hesitant to integrate the best features of other languages, though, so users will find elements of Perl and Java in PHP. For programmers familiarswith C, Perl, or Java, it should take only a matter of days to get acquainted with PHP. Thanks to the excellent reference manual, any one on a team of developers can probably produce small database enabled applications after just one afternoon.

By Tobias Ratschiller

s

Besides databases, PHP supports most current Internet standards including IMAP, FTP, POP, XML, WDDX, LDAP, NIS, and SNMP. For corporate and IT needs, this simply means that PHP is able to talk to different standards and technologies with ease: All from one common tool set, without requiring expensive third-party modules.

By Tobias Ratschiller

s By Tobias Ratschiller

s

Portability is the key to scalable applications. USers can run the same application on a low-scale Linux box and on a high-end Solaris machine, without worrying about platform-specific features. Also, PHP interfaces transparently with clustering solutions from simple Round Robin IP clusters to advanced Cisco solutions.

s

The broad platform support can be directly attributed to the fact that PHP is distributed with full source code. Anyone with the necessary skills can port PHP to a new operating system. The resulting modifications to the core system can then be contributed back to the community.

By Tobias Ratschiller

s

Then there's the community. Free help is available from mailing lists, newsgroups, and IRC channels. The PHP core developers participate in these support forums, and provide developers with top-level advice -- usually within hours. With time,scommercial support options will be available.

s

Open source brings with it the fact that rough edges are corrected promptly, and that the overall strategy is unbureaucratically adjusted to new requirements. For example, originally no one had thoughtsPHP would be used in most sophisticated business scenarios, and only version 4.0 is really prepared for this environment.








By Tobias Ratschiller

s By Tobias Ratschiller

sFurther information can be found on the following sites.
ServerWatch Tutorial: Welcome to the World of PHP
ServerWatch News: PHP 4 Released, New "Zend" Engine Official PHP Home Page: http://www.php.net
Zend Home Page: http://www.zend.com