1. It is the interface for PHP to run on the command line, which is different from the PHP environment running on the Web server.
2. Advantages: When using multiple processes, the kernel is responsible for recycling resources after the child process ends.
When using multiple processes, the abnormal exit of the child process will not cause the entire process thread to exit, and the parent process will have the opportunity to rebuild the process.
A resident main process is only responsible for task allocation, and its logic is clearer.
Example
Run a php file
php a.php php -f a.php
-f is optional. If command not found is prompted, please add the path to php to the environment variable and restart the command line.
The above is an introduction to the CLI mode in php. I hope it will be helpful to everyone.