O'Reilly logo

PHP 5 Power Programming by Derick Rethans, Stig Sæther Bakken, Andi Gutmans

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

16.1. Introduction

Traditionally, PHP is used in web environments to produce HTML markup that the user views in a web browser. The interaction between PHP and the web server (Apache, AOLserver, Microsoft IIS, or whatever) happens through a layer called SAPI (short for web Server API). A separate build of PHP is required to interface with each type of web server through SAPI.

In this chapter, you explore the CLI (short for Command Line Interface) server API, which makes PHP a traditional scripting language. This chapter demonstrates using CLI for writing command-line tools as well as a stand-alone server application.

Figure 16.1 shows what parts of PHP are present when it is built for different SAPI implementations.

Figure 16.1. Parts of PHP present ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required