Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home/blog66rr/public_html/wp-content/advanced-cache.php:24) in /home/blog66rr/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1723
{"id":4157,"date":"2016-11-29T12:34:51","date_gmt":"2016-11-29T04:34:51","guid":{"rendered":"http:\/\/blog.unethost.com\/?p=4157"},"modified":"2016-11-29T12:37:23","modified_gmt":"2016-11-29T04:37:23","slug":"how_to_fix_apache_error_log_script-timed-out-before-returning-headers-index","status":"publish","type":"post","link":"https:\/\/blog.unethost.com\/how_to_fix_apache_error_log_script-timed-out-before-returning-headers-index\/","title":{"rendered":"\u5982\u4f55\u89e3\u6c7a apache \u7684 error log \u51fa\u73fe: Script timed out before returning headers \u7684\u932f\u8aa4\u8a0a\u606f"},"content":{"rendered":"

\u6700\u8fd1\u6709\u5ba2\u6236\u4f7f\u7528\u7684\u5957\u88dd\u7a0b\u5f0f\uff0c\u56e0\u5176\u529f\u80fd\u89f8\u767c\u5f8c\u4e26\u7121\u6cd5\u9806\u5229\u904b\u4f5c\uff0c<\/strong><\/span>
\n\u6211\u5011\u900f\u904eerror log<\/a>\u89c0\u770b\u5f8c\u767c\u73fe\uff0c\u5176php\u7a0b\u5f0f\u6703\u79c0\u51faScript timed out before returning headers<\/span>\u7684\u932f\u8aa4\u5b57\u4e32\uff0c\u95dc\u65bc\u9019\u500b\u72c0\u6cc1\u5728\u4e3b\u6a5f\u7aef\u9019\u908a\uff0c
\n\u662f\u5c6c\u65bctimeout\u7684\u539f\u56e0\u5f15\u8d77\uff0c<\/strong>\u6240\u4ee5\u53ef\u4ee5\u8457\u624b\u505a\u4e0b\u5217\u5e7e\u7a2e\u4fee\u6b63:<\/strong><\/span><\/p>\n

<\/span><\/p>\n

\u4ee5\u4e0b\u4ecb\u7d39\u76f8\u95dctimeout\u7684\u72c0\u6cc1\u53ca\u5927\u81f4\u7684\u89e3\u6c7a\u65b9\u5411:<\/span><\/strong><\/span><\/p>\n

1.apache\u7684\u90e8\u4efd(\u6709\u5169\u7a2e\u6539\u6cd5<\/span>):<\/strong><\/span><\/p>\n

a.\u5982\u679c\u4f7f\u7528 whm\/cpanel\u7cfb\u7d71\uff0c\u5247\u4fee\u6539<\/span>
\n WHM > Apache Configuration > Global Configuration area<\/span><\/p>\n

b.\u6216\u662f\u4fee\u6539httpd.conf:<\/span><\/p>\n

\/usr\/local\/apache\/conf\/httpd.conf<\/span><\/pre>\n

 <\/p>\n

2.MySQL\u7684\u90e8\u4efd:<\/strong><\/span><\/p>\n

\u5728my.cnf \u589e\u52a0\u00a0wait_timeout = 120 (\u79d2\u6578\u4e0d\u9700\u904e\u5927)\u3002<\/span><\/p>\n

 <\/p>\n

3.PHP\u7684\u90e8\u4efd (\u6709\u4e09\u7a2e\u6539\u6cd5<\/span>):<\/strong><\/span><\/p>\n

a.\u5982\u679c\u4f7f\u7528 whm\/cpanel \u7cfb\u7d71\uff0c\u5247\u4fee\u6539:<\/span>
\n WHM > PHP Configuration Editor > Options & Information > max_execution_time<\/span><\/p>\n

b.\u6216\u662f\u76f4\u63a5\u4fee\u6539 php.ini\u3002<\/span><\/p>\n

c.\u7a0b\u5f0f\u7aef\u4e5f\u52a0\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u9806\u5229\u89e3\u6c7a:<\/span><\/p>\n

<?php\r\necho ini_get('max_execution_time');\r\n?><\/span><\/pre>\n

 <\/p>\n

4.FastCGI \/ mod_fcgid\u7684\u90e8\u4efd(\u57fa\u5e95\u662fapache):<\/span><\/p>\n

a.\u4fee\u6539\u7684\u53c3\u6578(\u53c3\u8003\u7528):<\/span><\/p>\n

<IfModule mod_fcgid.c>\r\nIdleTimeout 1800\r\nIPCCommTimeout 1800\r\nBusyTimeout 1800\r\nProcessLifeTime 1800\r\nIPCConnectTimeout 20\r\n<\/IfModule><\/span><\/pre>\n

b.\u53e6\u4e00\u7a2e\u4fee\u6539\u53c3\u6578(\u53c3\u8003\u7528):<\/span><\/p>\n

<IfModule mod_fcgid.c>\r\nFcgidIdleTimeout 1800\r\nFcgidProcessLifeTime 1800\r\nFcgidBusyTimeout 1800\r\nFcgidIOTimeout 1800\r\nFcgidConnectTimeout 20\r\n<\/IfModule><\/span><\/pre>\n

5.PHP-FPM\u7684\u90e8\u4efd(\u57fa\u5e95\u662fnginx)<\/strong><\/span><\/p>\n

a.\u9700\u4fee\u6539nginx.conf<\/span><\/p>\n

request_terminate_timeout = 0<\/span><\/pre>\n

b.\u6216\u662f<\/span><\/p>\n

fastcgi_read_timeout 150;<\/span><\/pre>\n

 <\/p>\n

\u4ee5\u4e0a\u6211\u5011\u5217\u51fa\u76f8\u95dc\u6539\u6cd5\uff0c\u6539\u5b8c\u5f8c\u9084\u662f\u5f97\u6e2c\u8a66\uff0c<\/strong><\/span>
\n\u4e26\u67e5\u770berror log\uff0c\u624d\u80fd\u9806\u5229\u89e3\u6c7a\u554f\u984c\u3002<\/strong><\/span><\/p>\n

 <\/p>\n

(\u672c\u7bc7\u6559\u5b78\u7531unethost.com\u5ba2\u670d\u64b0\u5beb<\/a>)<\/strong><\/span><\/p>\n

\u5ef6\u4f38\u95b1\u8b80:\u5982\u4f55\u5099\u4efdCpanel\u5f8c\u53f0\u5b89\u88dd\u7684\u5957\u88dd\u7a0b\u5f0f?<\/a><\/strong><\/p>\n

\u5b89\u88dd\u4e0a\u8ff0\u7684\u8edf\u9ad4\uff0c\u6211\u5011\u63d0\u4f9b\u865b\u64ec\u4e3b\u6a5f\u8a66\u7528\uff0c\u4e03\u5929\u6eff\u610f\u4fdd\u8b49\uff0c<\/span><\/strong>
\n\u529f\u80fd\u5b8c\u6574\u4f7f\u7528\u4e0d\u53d7\u9650\u5236\uff0c\u6b61\u8fce
\u9ede\u6211<\/a>\u7533\u8acb\u3002<\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"

\u6700\u8fd1\u6709\u5ba2\u6236\u4f7f\u7528\u7684\u5957\u88dd\u7a0b\u5f0f\uff0c\u56e0\u5176\u529f\u80fd\u89f8\u767c\u5f8c\u4e26\u7121\u6cd5\u9806\u5229\u904b\u4f5c\uff0c \u6211\u5011\u900f\u904eerror log\u89c0\u770b\u5f8c\u767c\u73fe\uff0c\u5176php\u7a0b\u5f0f\u6703 … \u95b1\u8b80\u5168\u6587 \u5982\u4f55\u89e3\u6c7a apache \u7684 error log \u51fa\u73fe: Script timed out before returning headers \u7684\u932f\u8aa4\u8a0a\u606f<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4160,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[151,309],"tags":[1158,1157,1159],"_links":{"self":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/4157"}],"collection":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/comments?post=4157"}],"version-history":[{"count":5,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/4157\/revisions"}],"predecessor-version":[{"id":4164,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/posts\/4157\/revisions\/4164"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/media\/4160"}],"wp:attachment":[{"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/media?parent=4157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/categories?post=4157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unethost.com\/wp-json\/wp\/v2\/tags?post=4157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}