Re: Blank Screens often in backend...Contao 2.9
Code:
AddEncoding gzip .gz
<FilesMatch "\.js\.gz$">
AddType "text/javascript" .gz
</FilesMatch>
<FilesMatch "\.css\.gz$">
AddType "text/css" .gz
</FilesMatch>
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME} \.(js|css)$
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.*)$ $1.gz [L]
This works, but if i remove the filesmatch or rewriteCond it doesn't.
My host assures me mod_headers is on.
I still need Settings::enable gzip though
Re: Blank Screens often in backend...Contao 2.9
Might be an Apache httpd 1.3 issue. The current .htaccess works great with the current Apache httpd 2.2 ;-)
Though it's good to know it works. I think you can file a ticket for having the "old" .htaccess included for Apache 1.3 (although I'm no fan of supporting old versions of software).
Re: Blank Screens often in backend...Contao 2.9
Sh*t sh*t shi*t and f*ck! :evil:
Thanks , but Forget it Flob.
I've just realised that although the htaccess/enable gzip solution is fixing my backend tinyMCE problem, it is giving me this in the frontend
Code:
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
This is triggered just by enabling gzip, with or without the changes to the default Contao htaccess.
I'm entirely sick of this, and have come to the conclusion Contao SIMPLY DOES NOT WORK out-of-the-box on apache 1.3 using mod_gzip.
Re: Blank Screens often in backend...Contao 2.9
Does it help splitting up the .htaccess between frontend and backend, i. e. using a separate .htaccess for the backend (in the folder /contao/)?
Re: Blank Screens often in backend...Contao 2.9
I don't think so, my problem now (and this may have something to do with all of it) is that "Settings:enable gzip" does not work on my installation at all.
I had never noticed this before, as I had never enabled it before.
Do you know in which Contao file the code that is triggered by this Settings:enable gzip switch resides? (gobblyspeak for "what does it do exactly"?)
I'll have another talk with my host about it. I think I need to figure out why the js compression doesn't work before anything else.
Re: Blank Screens often in backend...Contao 2.9
The var corresponding to the setting is $GLOBALS['TL_CONFIG']['enableGZip'], searching the code for this should reveal all important parts of the code.
Re: Blank Screens often in backend...Contao 2.9
Thanks Flob
system/libraries/Template.php is the only ref I can find.
Code:
// Activate gzip compression
if ($GLOBALS['TL_CONFIG']['enableGZip'] && (in_array('gzip', $arrEncoding) || in_array('x-gzip', $arrEncoding)) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression'))
{
ob_start('ob_gzhandler');
}
header('Content-Type: ' . $this->strContentType . '; charset=' . $GLOBALS['TL_CONFIG']['characterSet']);
echo $this->strBuffer;
What is the function 'ob_gzhandler' do you know????
I also saw this in the plugins/tinyMCE/tiny_mce_gzip.php file below (which is the blank screen problem!)
Code:
// Check if it supports gzip
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
$enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";
$supportsGzip = true;
}
EDIT: Found it http://php.net/manual/en/function.ob-gzhandler.php
I'll ask Mr Host about whether this function is accessible....
Re: Blank Screens often in backend...Contao 2.9
Re: Blank Screens often in backend...Contao 2.9
whoops, crossed you...
zlib enabled
zlib.output-compression is Off
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
Registered PHP Streams php, file, data, compress.bzip2, compress.zlib, https, ftps, tftp, ftp, telnet, dict, ldap, http, zip
Registered Stream Filters string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, bzip2.*, zlib.*, convert.iconv.*
Re: Blank Screens often in backend...Contao 2.9
Heres the headers (from Live Headers) for a Frontend page that shows as
Quote:
Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
when I check Settings::enable gzip
Quote:
http://www.***.net/lister-one.html
GET /lister-one.html HTTP/1.1
Host:
http://www.***.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-NZ; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-NZ,en;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer:
http://www.xxx.net/
Cookie: PHPSESSID=veurmud0bbf3n0f5hgr733kfs5; BE_USER_AUTH=6a9b3efb9dca6f0dbfe43f70233a1f7b8fea0 774; BE_PAGE_OFFSET=0
HTTP/1.1 200 OK
Date: Mon, 01 Nov 2010 22:21:00 GMT
Server: Apache
X-Powered-By: PHP/5.2.9
Cache-Control: no-cache, pre-check=0, post-check=0
Last-Modified: Mon, 01 Nov 2010 22:21:05 GMT
Expires: Wed, 28 Jan 1976 11:52:00 GMT
Pragma: no-cache
Vary: Accept-Encoding,*
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
X-Cnection: close
Content-Encoding: gzip
Do the headers indicate anything???
Re: Blank Screens often in backend...Contao 2.9
I'm certianly no HTTP expert, but those lines should be responsible for the error (at least to some extent):
Code:
Vary: Accept-Encoding,*
[…]
Transfer-Encoding: chunked
X-Cnection: close
Content-Encoding: gzip
Sorry, can't tell you any more … I don't know what browsers expect and what not.
Re: Blank Screens often in backend...Contao 2.9
Once again (like the javascript errors) the two problems were seperate.
The Settings::enable gzip was choking on certain pages only, generated by extensions I had added in while testing.
The gzip problem was caused by the encoding of one of the extensions class files.
Dos/Windows ANSI was the problem, changing the files encoding to Unix ANSI fixed it (I think a hidden BOM character causes this)
The end result was
Quote:
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression
with enable gzip is checked.
Tested, and enable gzip is working fine now.
The other thing I'll get to the bottom of yet. No pain no gain.