only for RuBoard - do not distribute or recompile Previous Section Next Section

E.2 Middle Tier Resources

This section lists resources that contain more information on the Apache web server, web performance tuning, networking, PHP programming, and third-party PHP add-ons including Integrated Development Environments (IDEs), script optimization tools, and commercially supported installation packages.

E.2.1 Web Server and Web Technology Resources

More information on the Apache web server can be found in the following resources:

More information on web servers, web performance tuning, and web performance modeling and traffic characteristics can be found in the following resources:

Here are some good background books that cover a range of topics in the middle tier, focusing on web servers and web technology, but are slightly out of date:

E.2.2 Networking and Web Resources

E.2.3 More About PHP

This book can't replace an introductory programming book or any of the excellent PHP resources that are available in add-on products or from the Web. This section is a brief overview of those resources.

E.2.3.1 Books

There are now more than 20 books covering PHP, and many of these also introduce interaction with the MySQL DBMS. We recommend the following books—in no particular order—as offering good coverage of PHP scripting topics:

Many books omitted from this list are also excellent books, but they may focus more on web database topics than on PHP, or they overlap significantly with the content of this book. A detailed and frequently updated list of all PHP and related books can be found at:

E.2.3.2 Web resources

The best place to start is to check the list of links at the official PHP site,

Here are some resources we frequently use:

The annotated online PHP manual at the official PHP site. Includes many comments for each library and function and tips on use and common problems encountered.

Site of the commercial company held by long-term developers of PHP. Includes articles, resources, free code, and tutorials.

Articles, tips, tutorials, and scripts; includes many tutorials on installation in a variety of environments.

Scripts, code fragments, and documentation.

Articles, documentation, and code fragments.

Tutorial-style articles on a range of PHP topics.

A simple, low-bandwidth site that contains PHP code fragments and some complete applications.

Julie Meloni's site that supports her two books described in the last section. Includes code and tutorials, some of which aren't covered in the books.

E.2.3.3 Libraries

PHP has many libraries available for most common tasks in web database applications. In this section, we list most of the PHP libraries and point to other chapters in which selected libraries are discussed in more detail. For most libraries, we provide brief or only partial information.

The following is an alphabetically sorted list of the libraries:

Apache HTTP server functions

Includes a function to retrieve all HTTP headers, getallheaders( ).

Array functions

There are almost 50 functions to sort, merge, split, iteratively process, and return information about arrays. We discuss many of these functions in detail in Chapter 2.

BCMath arbitrary precision mathematics functions

A library of functions to perform high-precision calculations with large numbers.

Bzip compression functions

Tools to read and write files compressed with Julian Seward's highly effective compression algorithm; however, it's a bit slow compared to gzip.

Calendar functions

For conversion between various calendars, including the Jewish and Gregorian calendars, and for finding the date of Easter.

CCVS API functions

RedHat's solution for credit card transaction processing.

Character type functions

Additional string functions to check what characters are contained within a string. These can be used as a replacement for or in addition to the validation methods described in Chapter 7.

ClibPDF function library

Requires purchase of a license if used for commercial applications: The ClibPDF library accesses a set of C functions for creating Adobe PDF documents. The C library ClibPDF is available from along with a licensing agreement.

CURL (client URL library) functions

Functions that communicate with resources using the FTP, gopher, HTTP, LDAP, Telnet, and other protocols.

Database functions

The MySQL library functions are discussed in detail in Chapter 4, with additional information on some functions in Chapter 5 and Chapter 6. Techniques for using the other DBMS libraries to connect to selected DBMSs are discussed briefly at the end of Chapter 4. Many other DBMS libraries are also available and detailed in the PHP manual; we don't discuss them here.

Date and time functions

The basics of date and time functions are described in Chapter 2. Examples are also discussed in Chapter 7.

Direct IO functions

A function library that accesses a file descriptor. The library is C-like in functionality, and C programmers will feel at home with the functions.

Directory functions

Changes directories in the filesystem, list files in a directory, etc.

Error handling and logging functions

Functions to change error reporting. Controlling the severity of PHP errors that are detected for debugging purposes is discussed in Chapter 2, and custom error handlers are discussed in Chapter 10.

Encryption functions

Selected encryption functions for producing cipher-text from plain text—and reversing the process—are discussed in Chapter 9.

eXtensible Markup Language (XML) functions

XML is a data format for structured document interchange, and this library provides tools to parse and retrieve components of XML documents.

Filesystem functions

Retrieves information about files, creates and modifies attributes of files, reads and writes files, and performs many other low-level file operations.

Forms Data Format functions

Tools to handle form data sent using the Forms Data Format (FDF) that's part of Adobe's PDF standard.


Functions that implement the File Transfer Protocol.

Functions functions

Seriously! A set of functions that inspects whether a function exists and returns details, such as the number of parameters to a function.

GNU teletext

A GNU project to internationalize programs by making substitution of program output messages in different languages easier.

GMP functions

More math functions for arbitrary-length integers using the GNU MP library; an alternative to the BCMath library described earlier in this section.

HTTP functions

The header( ) function creates HTTP headers in a response to a web browser. It is discussed and used in examples in Chapter 5 to Chapter 13. The function setcookie( ) sets a cookie in a web browser and is discussed in Chapter 8.

Hyperwave functions

This library offers functions to access the Hyperwave information system or document database. Use of the library requires purchase of the enterprise Hyperwave Information Server.

Image and graphics functions

Contains over 50 functions to draw images and render true-type fonts using the GD library.

IMAP, POP3, and NNTP functions

Network-oriented functions that use these protocols to retrieve and process email messages and Internet news postings.

IRC gateway

Functions to access an Internet relay chat (IRC) gateway. IRC is an Internet-base chat room.

Lightweight Directory Access Protocol (LDAP) functions

Tools to connect to and retrieve information from servers that store hierarchical directory information using LDAP.

Mail functions

Really one function, mail( ), to send an email to a destination; discussed in Chapter 12.

Mathematical functions

Functions to do just about anything to a number, but not to very large numbers (for those, use the BCMath or the GMP library); for example, the mathematical library includes trigonometry, random number generation, logarithm, and exponential functions. Many of these are discussed in Chapter 2.

Modular Calendar Access Library (MCAL) functions

Tools to access and manage an event calendar, such as a desktop diary, that is managed the underlying MCAL C library.

Ming functions for Flash

Tools that allows creation of Flash format movies.

mnoGoSearch functions

Functions that access the freely available text search engine mnoGoSearch.

Network functions

Networking libraries for high- and low-level network communications; for example, includes functions to check if a domain name exists, and convert numeric IP addresses to domain names and vice versa. A short background on networking can be found in Appendix B

Output control

Manages the buffering of output by PHP, allowing control of the PHP script engine's output.

PDF functions

Functions that create and manipulate Adobe Portable Document Format (PDF) documents.

POSIX functions

Functions that get information about processes, users, and other system-oriented aspects of functions defined in the IEEE 1003.1 (POSIX.1) standards document.

Program execution functions

These are discussed briefly in the context of securing a web database application in Chapter 5.

Pspell functions

Spelling functions that can not only check spelling but also make suggestions for corrections.

GNU Re-code functions

Functions that convert strings from one character set to another.

Regular expressions

Along with the string functions, an introduction to regular expression functions is covered in Chapter 2. (We cover only the native regular expression library that conforms to the POSIX 1003.2 standard, not the Perl-compatible regular expressions functions).

Satellite CORBA client extension functions

Functions that can access and use CORBA distributed objects.

Semaphore and shared memory functions

Functions based on Unix System V semaphores that allow multiple users controlled access to shared resources such as global variables in shared memory.

Session management functions

These functions are covered in detail in Chapter 8; an alternate session management module is discussed in Appendix D.

SHMOP shared memory functions

These functions duplicate the functionality of the System V shared memory tools described previously, but without some of the overheads in creating and managing shared memory spaces.

Simple Network Management Protocol (SNMP) functions

Functions that interact with SNMP agents to find available objects and to set those objects.

SWF Shockwave Flash functions

Another function library to create and use Flash format movies, with overlapping functionality to the Ming library described earlier.

Socket functions

Low-level network libraries to open, send, and receive data, and close network sockets (sockets are often loosely referred to as ports, which are discussed in Appendix B). Has some overlap with the network library, but the socket library is more concerned with low-level networking tasks.

String functions

The popular string functions are discussed in detail in Chapter 2.

URL (Uniform Resource Locator) functions

Tools that encode and decode MIME base64 encoded data used in HTTP and email, that encode and decode special characters from URLs, and that parse a URL and return its components.

Variable functions

Variable functions for determining and setting types are covered in Chapter 2.

Web Distributed Data eXchange (WDDX) libraries

Tools that process the XML-like format used in the open standard WDDX format, a standard that permits interchange of data between web-scripting languages such as PHP, ASP, and ColdFusion. More information about the WDDX Software Development Kit (SDK) can be found at

XSLT (eXtensible Stylesheet Language Transformations) functions

XSLT is a language for transforming XML documents from one standard XML format to another.

YAZ functions

A library that implements the Z39.50 protocol for information retrieval. Z39.50 can be used, for example, to issue a remote search on a text database and to return results in a standard format.

YP/NIS functions

Tools that manage network functions remotely, such as password files.

Zlib compression functions

A set of functions to read and write gzip files compressed using the algorithms of Jean-Loup Gailly and Mark Adler.

Several of these function libraries are immature and are dynamically being improved and changed. New libraries emerge every month. Some libraries are outdated, and the projects that underlie them are inactive. However, for most libraries, several successful installations and uses have been reported, and the latest details can usually be found along with example code at the PHP web site in the annotated manual,

We have omitted any discussion of wholly redundant libraries, those used exclusively with Microsoft Windows, very new libraries, unstable libraries, and those libraries that aren't used in web applications.

E.2.3.4 Third-party products
Zend Optimizer

A freely available code optimizer that improves the performance of the intermediate code generated by the Zend scripting engine. The Zend web site is

DBG: PHP Debugger

A free interactive debugger for PHP that includes a code profiler that finds code bottlenecks. Available for Microsoft Windows and Linux, and licensed under the same license as PHP. Available from:


BWare have recently released this free caching tool that caches PHP precompiled scripts in the web server for fast execution when a script is run a second or subsequent time. The afterBurner source code is available from

Alternative PHP Cache (APC)

An alternative free PHP script caching tool that is covered by the same license agreement as PHP itself. The APC source is available from

Zend is a company held by long-term developers of the PHP script engine. Their web site,, sells several commercial PHP-specific products:

Zend Cache

Tool that integrates with the Zend engine to better cache scripts, prevent some scripts being cached, and reduce latency. If high-throughput of a web database application is required, Zend Cache is a useful tool.

Zend Encoder

Tool that converts text scripts to an intermediate format that can be distributed, offering reasonable protection of copyright and the intellectual property in scripts.

Zend IDE

New integrated development environment for PHP that includes a customizable editor, syntax highlighting, and a debugger.

Zend Launchpad

Tool that allows systems administrators to maintain their PHP installation through upgrades. It also guides administrators through the PHP installation process and assists in selecting tools

NuSphere market several products that include and support PHP through their web site NuSphere products have optional additional email, web, and phone support. Here's a list:

ActiveState offer an IDE for Microsoft Windows and Linux called ASPN Komodo. Komodo can be used for free under the Linux operating system or for free under the Microsoft Windows environment by students, home users, and nonprofit organizations. A commercial license for Microsoft Windows is required for other uses. Komodo is available from There are several other IDEs for PHP available including the PHPub development environment, K PHP Develop, tsWebEditor, PHP Coder, and BBEdit.

E.2.3.5 Open source PHP applications

The following are popular examples of open source web database applications. Most either provide good solutions to common application requirements, or make excellent starting points for developing components or systems. The list isn't intended to be comprehensive but instead are representative examples of different application types.


A URL bookmarking management system,


Web site content management system for managing small- to medium-size web sites,


Web-based news and announcement system,

dev/coin online shop

For building simple online stores,


A system to automatically send out emails about birthdays and other events,


A customer billing and payment management system,


The Humble Portal Engine that brings together content to build a news portal,


The Incyte Project Manager for tracking and managing projects,

Les Visiteurs

A web site statistical analysis package for analyzing and producing information about site accesses,


A software development bug tracking system,


An email, calendar, contact, and event management system,


A web-based bulletin board forum,


A visitor guestbook,


A system to track your DVD collection,


A PHP-based chat room,


Reusable components to build an online shop,


A self-described rogue content management system,

only for RuBoard - do not distribute or recompile Previous Section Next Section