A Command Line Interface Server Application Programming Interface (CLI SAPI) has existed for PHP since v4.2, but only with the release of 4.3 did it come to maturity. In PHP 5 it is built automatically, and can be configured to be installed automatically also. Although you can use the code given here in previous versions of PHP, you may encounter problems with versions prior to PHP 4.3.
Next chapter: Why use shell scripts? >>
What else can be done with PHP?
Alternative PHP uses What else can be done with PHP? Command-line scripting Why use shell scripts? CLI SAPI differences Your first CLI script Advanced command-line parsing Getting down and dirty Getting into the swing of things Sending code direct to PHP The grand finale CLI Conclusion Graphical user interfaces Getting started GUI toolkits A Basic GUI Multiple Windows Handling popup menus Advanced GUIs Using Custom Parameters GUI Themes Distributing your apps Graphical Interfaces Conclusion Making games Text-based world planning Text game v1 Getting graphical Getting it to work First steps Moving our sprite Clearing the screen Last tweaks Games conclusion Making your own language Why make your own language? The elements of a compiler Analysis Output Planning it out How to parse text into tokens What is a token? How parsing works Finally, execution If you have made it this far... Operator precedence The script in (almost) full Mini-language conclusion Summary Further reading Next chapter
Table of Contents
Follow us on
Identi.ca or Twitter