Skip to Content
Mastering PHP 7
book

Mastering PHP 7

by Branko Ajzele
June 2017
Intermediate to advanced
536 pages
9h 49m
English
Packt Publishing
Content preview from Mastering PHP 7

Process control

Building CLI applications quite often implies working with the system processes. PHP provides a powerful process control extension called PCNTL. The extension allows us to handle process creation, program execution, signal handling, and process termination. It only works on Unix-like machines, where PHP is compiled with the --enable-pcntl configuration option.

To confirm that PCNTL is available on our system, we can execute the following console command:

php -m | grep pcntl

Given the power it bares, the use of the PCNTL extension is discouraged in production web environments. Writing PHP daemons scripts for command-line applications is what we want to use it for.

To start putting things into perspective, let's go ahead and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning PHP 7

Learning PHP 7

Antonio L Zapata (GBP)
Upgrading to PHP 5

Upgrading to PHP 5

Adam Trachtenberg

Publisher Resources

ISBN: 9781785882814Supplemental Content