© Robert Aley 2016

Rob Aley, PHP CLI, 10.1007/978-1-4842-2238-6_3

3. Understanding and Using the CLI SAPI

Rob Aley

(1)Oxford, UK

As mentioned in the previous chapter, PHP CLI scripting involves using the PHP CLI SAPI. It’s therefore important to have a good grasp of how to use it, know the options for configuring and running it, and understand how it differs from the web-based SAPIs you are used to using. Luckily, the differences are minimal, and many are intuitive.

What’s Different About the CLI SAPI?

The following are the main differences between the CLI SAPI and the standard web implementation :

  • No HTTP headers are written to the output by default. This makes sense because they hold no meaning in the command line and so would be just extraneous ...

Get PHP CLI: Create Command Line Interface Scripts with PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.