by Mark Gibbs

GEARHEAD INSIDE THE NETWORK MACHINE

We’ve always loved those smartalecky names that programmers give to their applications. In particular, we rejoice in the recursive names such as Pine and PHP Pine used to be one of the most widely used e-mail packages for Unix and came after another e-mail program called Elm. PINE is a recursive acronym that stands for “Pine Is Not Elm” (yes, you have to be a geek to find this stuff funny).

PHP which incidentally is our topic for this week, is also a recursive acronym that stands for “PHP: Hypertext Processor.” Not quite as clever as Pine but not bad.

The topic of PHP came up when some of you wrote in after the series of columns we did on Active Server Pages (ASP) (see www.nwfusion.com, DocFinder: 4639). What you wrote was along the lines of,”We couldn’t care less about ASP ’cause PHP rules, so why don’t you write about PHP unless you want us to come around and rough you up..”So we proudly present PHP!

In a nutshell, PHP is primarily a serverside scripting language (it also can be used client-side) that is used in much the same way as ASP But PHP has been around since 1994, and according to the Netcraft survey of technology in use on the Web, more than 6 million domains use PHP scripting and that number is growing at 15% per month (see www.php.net/ usage.php).

PHP (www.php.net) is a project run under the auspices of the Apache Software Foundation (www.apache.org) and the scripting engine - the PHP interpreter, called the Zend Engine - was developed and is published by Zend Technologies (www.zend.com).

The Zend Engine is open source, crossplatform and free! It runs on all flavors of Unix and Linux, Windows 98, ME, 2000, NT and XP,AmigaOS, Mac OS X,Novell NetWare, OS/2, RISC OS, SGI IRIX 6.5.x and AS/400.

So what makes PHP so popular? Well, other than being free, open source and cross-platform, we also suspect that being non-Microsoft attracts a lot of people. Even so, the really big advantages are that PHP allows for elegant coding and offers great performance.And PHP is also fairly easy to learn for even novice programmers - it has syntax similar to that of C or Perl.

PHP is also versatile - it supports HTTP sessions, Java connectivity, regular express sions and a full alphabet soup of protocols, including LDAP SNMP IMAP and, under Windows, COM. PHP also supports a relatively new, very cool and definitely groovy XML-based data exchange standard called WDDX, which we will discuss in a future column.

As for Web server support, PHP supports ISAPI or, as an alternative, a direct module interface called SAPI, which offers better performance and is compatible with Apache, Microsoft Internet Information Server, Netscape and iPlanet servers. You also can use PHP as a CGI processor, which requires the command-line executable version of PHP.

With PHP you are not limited to outputting HTML - you also can output images, PDF files, Flash movies, XHTML content and, obviously, any XML content. There are all sorts of libraries to make these formats easy to create.

If you are committed to PHP programming you can create client-side GUI applications using something called the PHPGTK (see http://gtk.php.net), a cross-platform windowing library.

Another major strength of PHP lies in its database support - writing database applications using PHP is simpler than in many other languages. PHP supports Adabas D, Ingres, Oracle (OC17 and OC18), dBase, InterBase, Ovrimos, Empress, Front– Base, PostgreSQL, FilePro (read-only), mSQL, Solid, Hyperwave, Direct MS-SQL, Sybase, IBM DB2, MySQL,Velocis, Informix, ODBC and Unix dbm (whew!).

Installing PHP is pretty easy - see DocFinder: 4640 for general instructions and detailed instructions for specific operating systems.

Once installed,there are a number of run time configuration options that are stored in the php.ini file - see DocFinder: 4641. The location of this file depends on the operating system and any specific options compiled into the executable - see DocFinder:4642.

So by now you must be wondering what a Web page with a PHP script looks like. Here’s the standard “Hello world” script in PHP:

<?php echo “Hello World” ?> 

No surprises there, eh? Next week, we’ll delve deeper.

Deep thoughts to gearhead@gibbs.com

Mark Gibbs

Deep thoughts to gearhead@gibbs.com.

Copyright Network World Inc. Mar 10, 2003
Provided by ProQuest Information and Learning Company. All rights Reserved