© Robert Aley 2016

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

5. PHP CLI Scripts and Your System

Rob Aley

(1)Oxford, UK

PHP CLI scripts typically interact with your system in a number of areas. While most system interactions are identical to those you’re used to with web scripts, there are a few areas you may not have used much, so I’ll cover a few gotchas that might trip you up.

Starting External Processes from PHP, or “Shelling Out”

A common feature of CLI scripts is calling and interacting with other scripts and processes. Using other scripts and programs as “building blocks” within your script is a common pattern of CLI programming. As you saw earlier, you can often combine your PHP script with others in general-purpose shell scripts, but ...

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.