I am trying to change the project status from Kohana::DEVELOPMENT to Kohana::PRODUCTION

I write in .htaccess the following

 SetEnv KOHANA_ENV production 

But as a result, when switching to a non-existing page, the Kohana error handler still displays

 HTTP_Exception_404 [ 404 ]: Unable to find a route to match the URI: media/xml/export/orders.xml SYSPATH/classes/kohana/request.php [ 1126 ] 1121 */ 1122 public function execute() 1123 { 1124 if ( ! $this->_route instanceof Route) 1125 { 1126 throw new HTTP_Exception_404('Unable to find a route to match the URI: :uri', array( 1127 ':uri' => $this->_uri, 1128 )); 1129 } 1130 1131 if ( ! $this->_client instanceof Request_Client) DOCROOT/index.php [ 109 ] » Kohana_Request->execute() 

    2 answers 2

     ini_set('display_errors', isset($_SERVER['DEVELOPERS'])); Kohana::init(array( 'base_url' => '/', 'index_file' => '', 'charset' => 'utf-8', 'cache_dir' => APPPATH.'/cache', 'errors' => isset($_SERVER['DEVELOPERS']), 'profile' => false, 'caching' => true, )); 

    My bootstrap.php is configured this way. You can simply replace the isset ($ _ SERVER ['DEVELOPERS']) with FALSE and that's it.

      In index.php or bootstrap.php find the line DEVELOPMENT (development), replace with PRODUCTION (product). Who told you in .htaccess climb - kill him :)

      • in the bootstrap, only the following is written if (isset ($ _ SERVER ['KOHANA_ENV'])) {Kohana :: $ environment = constant ('Kohana ::'. strtoupper ($ _ SERVER ['KOHANA_ENV'])); } - Demyan112rv
      • Yes, you can put PRODUCTION right in the bootstrap and that's it - johniek_comp
      • delete it all and write just Kohana :: $ environment = Kohana :: PRODUCTION; - johniek_comp
      • added below Kohana :: $ environment = Kohana :: PRODUCTION; No result - Demyan112rv