In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Today, I would like to talk to you about what is the understanding of the php-cli environment, many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
Php-cli I saw when I was watching swoole. Swoole_server can only be used in the php-cli environment. What is the php-cli environment? so Baidu copied the introduction that I found more useful on the Internet.
What is the php_cli mode?
Php-cli is different from the php environment running on Web servers. Php can not only write foreground web pages, it can also be used to write background programs.
Recommended: "PHP tutorial"
Advantages of php_cli mode
Using multiple processes, after the child process ends, the kernel will be responsible for recycling resources
two。 With multiple processes, the abnormal exit of a child process does not cause the entire process Thread to exit. The parent process also has the opportunity to rebuild the process.
3. A resident main process, only responsible for task distribution, the logic is clearer.
4. Full support for multithreading
5. As above, scheduled tasks can be realized.
6. Desktop applications are developed using PHP-CLI and GTK packages.
Write shell script with php under 7.linux
How to run the PHP CLI script
The first method is to use php-f / path/to/yourfile.php. Invoke the PHP CLI interpreter and pass parameters to the script. The first step of this method is to set the path of the php interpreter. Before running CLI, the Windows platform needs to set a command similar to path c:\ php, which also loses the meaning of the first line of the CLI script, so this method is not recommended.
The second way is to first run chmod+x (UNIX/Linux environment), make the PHP file executable, then add a declaration on the first line of the CLI script header (similar to the #! / usr/bin/php or PHP CLI interpreter location), and then execute it directly on the command line. This is the preferred method for CLI and is recommended
After reading the above, do you have any further understanding of the understanding of the php-cli environment? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.