Skip to main content

Book: Programming PHP

Overview
Programming PHP is a practical guide to the PHP scripting language as it stood in the early 2000s, written by Rasmus Lerdorf with Kevin Tatroe and Peter MacIntyre. It presents both core language features and the routines commonly used to build dynamic web applications, blending tutorial guidance with concise reference material. The tone is pragmatic and experience-driven, reflecting the authors' deep involvement with PHP's design and deployment.

Authoritative voice
Rasmus Lerdorf's role as PHP's original creator gives the book an authoritative perspective on language design, common pitfalls, and best practices. Kevin Tatroe and Peter MacIntyre add operational and implementation insights that expand beyond syntax and examples to cover real-world deployment and extension. The result is a resource that speaks to both programmers learning the language and engineers responsible for integrating PHP into production systems.

Content and structure
The book begins with installation, configuration, and embedding PHP within HTML so readers can quickly create interactive pages. Core language topics follow: variables, types, arrays, control structures, functions, and a practical discussion of PHP's then-current object model. Coverage moves into web-specific features such as form handling, cookies, sessions, and state management. Later sections tackle interacting with databases, file handling, regular expressions, and network programming, while appendices and reference material provide quick lookups for functions and configuration directives.

Practical examples and techniques
Examples are concrete and task-oriented, illustrating common patterns like input validation, templating approaches, building simple content-management behaviors, and using PHP to glue together HTML, databases, and the filesystem. Code snippets are used to demonstrate idioms and to show common failure modes and how to avoid them. Explanations emphasize readable, maintainable code and often include performance considerations that matter when applications move from development to production.

Deployment, extensions, and internals
A distinctive portion of the book addresses server integration and extension authoring. Readers learn how PHP interfaces with web servers, how to configure runtimes for different environments, and how to write extensions or embed C code for performance-critical paths. Coverage of PHP's internal architecture and APIs demystifies the boundary between interpreted scripts and compiled modules, which is especially valuable for teams pushing PHP beyond simple scripting tasks.

Security and performance
Security is treated as a first-class concern, with practical guidance on avoiding common vulnerabilities such as injection attacks, cross-site scripting, and insecure file handling. Performance topics include opcode caching strategies of the era, efficient use of database connections, and tips for optimizing I/O-bound code. The advice is pragmatic and oriented toward making web applications both robust and responsive under load.

Audience and use
Programming PHP targets web developers who need a solid, pragmatic foundation in PHP and system administrators tasked with deploying PHP-based services. Beginners will find guided introductions to core concepts, while intermediate and advanced readers benefit from discussions of internals, extension writing, and real-world deployment. The book serves well as both a hands-on tutorial and a desk reference for day-to-day development.

Legacy and relevance
As a snapshot of PHP during its rapid early growth, the book documents conventions, trade-offs, and techniques that shaped many web projects. While language features and best practices have evolved since 2002, the emphasis on practical problem solving, secure coding, and understanding runtime behavior remains relevant for anyone studying PHP's roots or maintaining legacy systems written for that era.
Programming PHP

Programming PHP is a book written by Rasmus Lerdorf, Kevin Tatroe, and Peter MacIntyre, teaching readers programming PHP scripting language and how to create dynamic web applications.


Author: Rasmus Lerdorf

Rasmus Lerdorf Rasmus Lerdorf, the Danish-Canadian software engineer and creator of PHP, a cornerstone of web development.
More about Rasmus Lerdorf