magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2001 > 01 > Script Junkie  

Extending PHP

By Sterling Hughes

As my grandfather always says, "If you want something done right, do it yourself." However, these days you often have to rely on third-party tools to help you get your job done. To serve even a simple, static HTML Web page you need to rely on your Web server, which in turn relies on your operating system, and so on. While you can't create all these programs yourself, most of the ones that you rely on—your Web server, for example—provide an API to help you extend and add functionality to these programs, so if they don't meet your needs you can always modify them.

PHP—or more properly the PHP Hypertext Preprocessor—lets you easily create dynamic Web sites by embedding code into the Web page (HTML) itself. This open-source software is very popular on the Web where open-source products like Apache and Perl predominate. While PHP offers considerable power as a scripting language, its true power lies in the fact that if it doesn't offer what you need, you can easily extend it with either C or C++. To extend PHP 4, you need to understand the PHP API (more specifically the Zend API, since PHP 4 is powered by the Zend Engine).

A Quick Overview

Before you extend PHP, you should understand how Zend and PHP interact. There are several steps:

  • The user makes an ordinary request to the Web server.

  • The Web server sends the request to PHP.

  • PHP calls the Server API layer.

The Zend Engine compiles and executes the script, using any enabled extension modules.<>




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2