Firefox hlásí Chyba kódování obsahu
- Melmen
- Člen | 132
Ahoj,
Updatoval jsem Nette na poslední verzi z Githubu. Na localhostu jsem to
nezkoušel, ale na produkčním, pokud mám v bootstrapu
Debugger::enable(Debugger::DEVELOPMENT);
nebo
Debugger::enable('mojeIpAdresa')
, Firefox na mně vyskočí
s touto hláškou:
Chyba kódování obsahu
Stránka, kterou se snažíte načíst, nemůže být zobrazena, jelikož server používá neplatný či nepodporovaný způsob komprimace dat.
Kontaktujte prosím vlastníka webového serveru a informujte ho o tomto problému.
Pokud mám jen Debugger::enable()
tak se vše správně loguje a
funguje. Posílám celý bootstrap a config.neon:
Bootstrap:
<?php
/**
* My Application bootstrap file.
*/
use Nette\Diagnostics\Debugger,
Nette\Application\Routers\Route,
Nette\Application\Routers\RouteList,
Nette\Application\Routers\SimpleRouter;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
// Enable Nette Debugger for error visualisation & logging
Debugger::$logDirectory = __DIR__ . '/../logger';
Debugger::$strictMode = TRUE;
Debugger::enable(Debugger::DEVELOPMENT);
// Configure application
$configurator = new Nette\Config\Configurator;
$configurator->setTempDirectory(__DIR__ . '/../tmp');
// Enable RobotLoader - this will load all classes automatically
$configurator->createRobotLoader()
->addDirectory(APP_DIR)
->addDirectory(LIBS_DIR)
->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
// Opens already started session
if ($container->session->exists()) {
$container->session->start();
}
// Translator
$container->getService('translator')->addFile("%appDir%/lang/","home"); // add block homepage to (app/lang/{lang}.homepage.mo
// $configurator->container->getService("translator")->addFile("%appDir%/lang/","about"); // add another block, if you need to separate particular pages
NetteTranslator\Panel::register($container, $container->translator);
// Setup router using mod_rewrite detection
if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) {
$container->router = $router = new RouteList;
$router[] = new Route('index.php', 'Front:Default:default', Route::ONE_WAY);
$router[] = $adminRouter = new RouteList('Admin');
$adminRouter[] = new Route('admin/<presenter>/<action>', 'Homepage:default');
$router[] = $frontRouter = new RouteList('Front');
$frontRouter[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
} else {
$container->router = new SimpleRouter('Front:Homepage:default');
}
// Configure and run the application!
$application = $container->application;
$application->catchExceptions = FALSE;
$application->errorPresenter = 'Error';
$application->run();
Config.neon:
#
# SECURITY WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser!
#
# If you don't protect this directory from direct web access, anybody will be able to see your passwords.
# https://nette.org/en/security-warning
#
common:
parameters:
database:
type: mysql
driver: mysql # localhost, mysql5
dbname: php# your db name
host: localhost
username: php
password: php
profiler: TRUE
charset: utf8
langDir: %appDir%/lang # route to lang files
lang: cs_CZ
php:
date.timezone: Europe/Prague
session.save_path: "%tempDir%/sessions"
# zlib.output_compression: yes
services:
# authenticator
authenticator:
class: Authenticator
arguments: [@database]
# /authenticator
# NotORM
factories:
class: FactoryLoader
databasePDO:
factory: [@factories, 'createPDO']#class: PDO
arguments: ['%database.driver%:host=%database.host%;dbname=%database.dbname%',%database.username%,%database.password%]
database:
factory: [@factories, 'createNotORM']
arguments: [@databasePDO, true]
modelLoader:
class: ModelLoader
arguments: [@container]
# /NotORM
# translator
translator:
factory: NetteTranslator\Gettext::getTranslator
# /translator
production < common:
development < common:
database:
host: localhost
username: root
password:
Setkal se s tím někdo? Díky za každou radu :)
- Melmen
- Člen | 132
Zkusil jsem zapnout Firebug a v hlavičce je akorát:
HTTP/1.1 500 Internal Server Error
Server: nginx/1.0.11
Date: Thu, 05 Jan 2012 14:14:37 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked, chunked
Connection: keep-alive
X-Powered-By: Nette Framework
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=uieu79ga2psbct87j0lvtpdfq2; path=/; httponly
nette-browser=g4ta1z7dxh; path=/; httponly
Vary: Accept-Encoding
Content-Encoding: gzip
Zajímavý, že se nezobrazí ErrorPresenter ale firefox onu chybu..
Na serveru v error logu taky nic nemám :(
EDIT//
V opeře mi to vyplivne akorát divný znaky
::
1faa ��{��8�w�*ܴ���.�KHv7�G�$d���6��1�c;�ɭ��?�� 2��l{H�`lkf$�fF����/�V�w�n0c}*�}�%�b6�1����Ʃ���
�Y�[Q���T��:;��~����/��{?��y t�ҕ�� _6j��IO���p�ח <�T�ÍYU�>LU6, ;_6Ty 뚣�$
Editoval Melmen (5. 1. 2012 15:29)
- David Grudl
- Nette Core | 8228
Setkal. Má to něco společného s kódováním do gzip. Zkus se podívat, jestli někde není direktiva zlib.output_compression, volání ob_start(„ob_gzhandler“) nebo tak něco.