Welcome Guest, Not a member yet? Register   Sign In
Content Encoding Error
#1

[eluser]johnwbaxter[/eluser]
I totally forgot about CI's compress_output config option. So i enabled it today on a test site.

As soon as i try to load the site firefox tells me:

Quote:Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

* Please contact the web site owners to inform them of this problem.

Any ideas as to why this might be?
#2

[eluser]Sean Gates[/eluser]
If you have any errors in your PHP this will break compression. Today I had the same problem. I read this in the comments of the config file:
Code:
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads.  When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT:  If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts.  For
| compression to work, nothing can be sent before the output buffer is called
| by the output class.  Do not "echo" any values with compression enabled.
So, I went in to the main index.php file and set:
Code:
error_reporting(E_ALL);
to
Code:
error_reporting(E_ALL ^ E_NOTICE);
Worked from that point on.

-- Sean
#3

[eluser]johnwbaxter[/eluser]
I tried that and it makes no difference, i have removed the closing php tag from the controller, i haven't echoed anything in the view (used <?= instead) and i have made sure there is no white space at all after the last curly brace in the controller. I still get the same errors.

I tried it in safari too and get this error:

Quote:The error was: “cannot decode raw data” (NSURLErrorDomain:-1015)

I'm not sure what else it could be.
#4

[eluser]Unknown[/eluser]
I'm new to CI and was getting an error similar to the one posted at the head of thread (I found the thread via google). Once I turned compression off it went away.

Several points
1) It was not occurring on all model / view / controller examples;
2) There appears to be no PHP or DB errors in the affected model / view / controller;
3) I am running PHP 5.1.?? / CI 1.7 on Linux / Apache
#5

[eluser]bastones[/eluser]
Try re-uploading the config folder because a file in there may have been modified that is causing that problem as surely this can't be a problem residing in your code Smile.
#6

[eluser]Antivanity[/eluser]
I had this same issue, some pages worked, some didnt. I finally figured out that you can not have "?>" at the end of a controller.

hope this helps someone else..

I realize this is an old thread, but the only thread regarding the encoding errors i was experiencing and figured it give the solution that i found..
#7

[eluser]nirbhab[/eluser]
Hi,

I think this is because of after you auto load output library.
You cannot use echo/print or try to display any content in controller.
And you will have to use the views/output library to produce the content.

Please do correct me if i am wrong.

Regards
#8

[eluser]npCoda[/eluser]
It also can be done by changing the status of comprress_output to FALSE in config.php file.

Code:
$config['compress_output'] = FALSE;




Theme © iAndrew 2016 - Forum software by © MyBB