简体   繁体   English

净:: ERR_INCOMPLETE_CHUNKED_ENCODING

[英]net::ERR_INCOMPLETE_CHUNKED_ENCODING

I use .htaccess to rewrite url from someurl.com/ to someurl.com/public/.我使用 .htaccess 将 url 从 someurl.com/ 重写为 someurl.com/public/。 First .htaccess in www root contains this: www root 中的第一个 .htaccess 包含以下内容:

DirectoryIndex ./public/
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ ./public/$1  [QSA]

and second one in folder /public/ contains this:文件夹 /public/ 中的第二个包含以下内容:

DirectoryIndex _main.php
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ ./?params=$1 [QSA]

And the problem is when I open url someurl.com/ without "public".问题是当我打开 url someurl.com/ 时没有“公开”。 Page is loaded correctly, but in Google Chrome console I got error:.net::ERR_INCOMPLETE_CHUNKED_ENCODING.页面加载正确,但在 Google Chrome 控制台中出现错误:.net::ERR_INCOMPLETE_CHUNKED_ENCODING。 When I open url someurl.com/public/ page loads without any error.当我打开 url someurl.com/public/ 页面加载时没有任何错误。

Any ideas, please?有什么想法吗?

In my case, the problem was cache-related and was happening when doing a CORS request. 就我而言,问题与缓存有关,并且在执行CORS请求时发生了。

I post my response here cause this is the first resource I found on Google for net::ERR_INCOMPLETE_CHUNKED_ENCODING error. 我在这里发布我的回复,因为这是我在Google上发现的第一个net::ERR_INCOMPLETE_CHUNKED_ENCODING错误资源。

Forcing the response header Cache-Control to no-cache resolved my issue: 强制响应头Cache-Control no-cache解决了我的问题:

[ using Symfony HttpFoundation component ] [使用Symfony HttpFoundation组件]

<?php
$response->headers->add(array(
   'Cache-Control' => 'no-cache'
));

I had this issue when trying to access some parts of the WP admin area, I managed to resolve it by adding the below to my functions.php file; 我试图访问WP管理区域的某些部分时遇到了这个问题,我设法通过将以下内容添加到我的functions.php文件来解决它;

add_filter('wp_headers', 'wpse167128_nocache');
function wpse167128_nocache($headers){
    unset($headers['Cache-Control']);
    return $headers;
}

We had net::ERR_INCOMPLETE_CHUNKED_ENCODING problem in case of HTML, which contained too much empty lines. 在HTML的情况下,我们有net::ERR_INCOMPLETE_CHUNKED_ENCODING问题,其中包含太多空行。 Some browsers had difficulties with interpretation of long files. 有些浏览器难以解释长文件。

Once we made applied code cleaning in our templates by cleaning code from empty lines, all was perfect. 一旦我们通过清空空行代码在模板中应用代码清理,一切都很完美。

I was also facing same issue. 我也面临同样的问题。 Finally i got this was the permission issue on cache folder. 最后我得到的是缓存文件夹上的权限问题。

I decided changing the file : /etc/apache2/mods-enabled/cgid.conf 我决定更改文件: /etc/apache2/mods-enabled/cgid.conf
Adding the following code snippet: 添加以下代码段:

<IfModule mod_cgid.c>
    CGIDScriptTimeout 60
</IfModule>

这个问题非常普遍,在我的情况下,我停用了WP超级缓存插件,并且没有得到错误,但是这是如此普遍以至于没有人可以真正帮助你因为服务器/ wordpress的不同配置

In my case, the problem was the Windows anti-virus software (Kaspersky). 就我而言,问题是Windows防病毒软件(卡巴斯基)。 Turning it off, the problem was gone :/ 关掉它,问题就消失了:/

For me it was the Zend PHP Opcache. 对我来说,它是Zend PHP Opcache。 It had reached its memory limit and could no longer cache all scripts. 它已达到内存限制,无法再缓存所有脚本。 This was a problem for a massive code base like Magento 2. 对于像Magento 2这样庞大的代码库来说,这是一个问题。

Increasing the memory limit solved the issue after weeks of banging head on desk. 经过数周的敲击后,增加内存限制解决了这个问题。

It is about server side problem.这是关于服务器端问题。 The user has running web service does not right access to web server cache folder.用户已运行 web 服务无权访问 web 服务器缓存文件夹。

  1. Make sure nginx user can write to /var/lib/nginx (or /var/cache/nginx in some distros).确保 nginx 用户可以写入 /var/lib/nginx(或某些发行版中的 /var/cache/nginx)。
  2. Make sure nginx user can write to the folder (find the nginx user form nginx configuration file is located usually in /etc/nginx/nginx.conf)确保 nginx 用户可以写入该文件夹(找到 nginx 用户表单 nginx 配置文件通常位于 /etc/nginx/nginx.conf)
  3. Give the right access (chown -R nginx:nginx /var/lib/nginx/) Reload the service(-service nginx reload -in centos)授予权限 (chown -R nginx:nginx /var/lib/nginx/) 重新加载服务(-service nginx reload -in centos)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM