In PHP development, I often use timeout processing to timeout. I will talk about several scenarios, it is convenient for users who need to work in PHP development to use timeout handling to timeout. I will talk about several scenarios:
1.
In the PHP development work very much uses in the timeout processing to the timeout situation, I said several scenes:
1. Get data asynchronously if one of the backend data sources is unsuccessful, skip, not affect the entire page presentation
2. To
PHP operating mode has 5 minutes:1) CGI Universal Gateway Interface (Common Gateway Interface))2) fast-cgi resident (long-live) type CGI3) CLI command line run (Interface)4) ISAPI mode (used in Windows)5) Web module mode (module mode for Web server
This article assumes that you have installed Linux (the Linux version of this article is Fedora Core3) and has root permissions.
1, install ApacheFirst download the latest version of Apache HTTP server to Apache's home page, address
Sometimes, running Nginx, PHP-CGI (php-fpm) Web service Linux server, suddenly the system load increases, use the top command to view, many php-cgi process CPU usage is close to 100%. Later, I found through tracking that the appearance of such cases
Sometimes, running Nginx, PHP-CGI (php-fpm) Web service Linux server, suddenly the system load increases, use the top command to view, many php-cgi process CPU usage is close to 100%. Later, I found through tracking that the appearance of such cases
Sometimes, running Nginx, PHP-CGI (php-fpm) Web service Linux server, suddenly the system load increases, use the top command to view, many php-cgi process CPU usage is close to 100%. Later, I found through tracking that the appearance of such cases
Later, I tracked and found that this kind of situation is closely related to the PHP file_get_contents () function.
In large and medium-sized websites, API interface calls based on HTTP protocol are commonplace. PHP programmers like to use the
First of all to analyze the reasons for the timeout:
1. The network is not smooth.
2. Background running slower (the first time the server is running, easy to appear)
Timeout Result: Timeout set request timeout in JQ.
Enter error (Error handling)
Later, I tracked the discovery that this kind of situation is closely related to PHP's file_get_contents () function.
In large and medium-sized Web sites, API interface calls based on the HTTP protocol are commonplace. PHP programmers like to use
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.