Ogólnie chciałem się nauczyć frameworka, więc wrzuciłem zainstalowałem i nie robiłem nic więcej. Niestety czysta kohana wywala błędami. Próbowałem powyższego kodu ale to samo ;/. Jak dałem bezpośredni adres
http://moj.host/kohana3/index.php błąd jest troche inny:
Kod
Kohana_Request_Exception [ 0 ]: Unable to find a route to match the URI: kohana3/index.php
SYSPATH/classes/kohana/request.php [ 635 ]
630 }
631
632 // No matching route for this URI
633 $this->status = 404;
634
635 throw new Kohana_Request_Exception('Unable to find a route to match the URI: :uri',
636 array(':uri' => $uri));
637 }
638
639 /**
640 * Returns the response as the string representation of a request.
i
1. SYSPATH/classes/kohana/request.php [ 272 ] ť Kohana_Request->__construct(arguments)
267
268 // Remove all dot-paths from the URI, they are not valid
270
271 // Create the instance singleton
272 Request::$instance = Request::$current = new Request($uri);
273
274 // Add the default Content-Type header
275 Request::$instance->headers['Content-Type'] = 'text/html; charset='.Kohana::$charset;
276 }
277
2. APPPATH/bootstrap.php [ 95 ] ť Kohana_Request::instance()
90
91 /**
92 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
93 * If no source is specified, the URI will be automatically detected.
94 */
95
echo Request
::instance() 96 ->execute()
97 ->send_headers()
98 ->response;
3. DOCROOT/index.php [ 103 ] ť require(arguments)
98 // Load empty core extension
99 require SYSPATH.'classes/kohana'.EXT;
100 }
101
102 // Bootstrap the application
103 require APPPATH.'bootstrap'.EXT;
Poprzednia wersja 2.x działała bez problemu, po zainstalowaniu tej mimo że w innym katalogu nic nie działa i już nie wiem ...
routes.php mam taki:
<?php defined('SYSPATH') OR
die('No direct access allowed.'); /**
* @package Core
*
* Sets the default route to "welcome"
*/
$config['_default'] = 'welcome';
w bootstrap.php nic nie zmieniałem a jak zmieniłem nic nie dało.
zamieszczam jeszcze 2 pliki
config.php
<?php defined('SYSPATH') OR
die('No direct access allowed.'); /**
* Base path of the web site. If this includes a domain, eg: localhost/kohana/
* then a full URL will be used, eg: <a href="http://localhost/kohana/" target="_blank">http://localhost/kohana/</a>. If it only includes
* the path, and a site_protocol is specified, the domain will be auto-detected.
*/
$config['site_domain'] = '/';
/**
* Force a default protocol to be used by the site. If no site_protocol is
* specified, then the current protocol is used, or when possible, only an
* absolute path (with no protocol/domain) is used.
*/
$config['site_protocol'] = '';
/**
* Name of the front controller for this application. Default: index.php
*
* This can be removed by using URL rewriting.
*/
$config['index_page'] = 'index.php';
/**
* Fake file extension that will be added to all generated URLs. Example: .html
*/
$config['url_suffix'] = '';
/**
* Length of time of the internal cache in seconds. 0 or FALSE means no caching.
* The internal cache stores file paths and config entries across requests and
* can give significant speed improvements at the expense of delayed updating.
*/
$config['internal_cache'] = FALSE;
/**
* Internal cache directory.
*/
$config['internal_cache_path'] = APPPATH.'cache/';
/**
* Enable internal cache encryption - speed/processing loss
* is neglible when this is turned on. Can be turned off
* if application directory is not in the webroot.
*/
$config['internal_cache_encrypt'] = FALSE;
/**
* Encryption key for the internal cache, only used
* if internal_cache_encrypt is TRUE.
*
* Make sure you specify your own key here!
*
* The cache is deleted when/if the key changes.
*/
$config['internal_cache_key'] = 'foobar-changeme';
/**
* Enable or disable gzip output compression. This can dramatically decrease
* server bandwidth usage, at the cost of slightly higher CPU usage. Set to
* the compression level (1-9) that you want to use, or FALSE to disable.
*
* Do not enable this option if you are using output compression in php.ini!
*/
$config['output_compression'] = FALSE;
/**
* Enable or disable global XSS filtering of GET, POST, and SERVER data. This
* option also accepts a string to specify a specific XSS filtering tool.
*/
$config['global_xss_filtering'] = TRUE;
/**
* Enable or disable hooks.
*/
$config['enable_hooks'] = FALSE;
/**
* Log thresholds:
* 0 - Disable logging
* 1 - Errors and exceptions
* 2 - Warnings
* 3 - Notices
* 4 - Debugging
*/
$config['log_threshold'] = 1;
/**
* Message logging directory.
*/
$config['log_directory'] = APPPATH.'logs';
/**
* Enable or disable displaying of Kohana error pages. This will not affect
* logging. Turning this off will disable ALL error pages.
*/
$config['display_errors'] = TRUE;
/**
* Enable or disable statistics in the final output. Stats are replaced via
* specific strings, such as {execution_time}.
*
* @see <a href="http://docs.kohanaphp.com/general/configuration" target="_blank">http://docs.kohanaphp.com/general/configuration</a>
*/
$config['render_stats'] = TRUE;
/**
* Filename prefixed used to determine extensions. For example, an
* extension to the Controller class would be named MY_Controller.php.
*/
$config['extension_prefix'] = 'MY_';
/**
* Additional resource paths, or "modules". Each path can either be absolute
* or relative to the docroot. Modules can include any resource that can exist
* in your application directory, configuration files, controllers, views, etc.
*/
$config['modules'] = array (
// MODPATH.'auth', // Authentication
// MODPATH.'kodoc', // Self-generating documentation
// MODPATH.'gmaps', // Google Maps integration
// MODPATH.'archive', // Archive utility
// MODPATH.'payment', // Online payments
// MODPATH.'unit_test', // Unit testing
);
bootstrap.php
<?php defined('SYSPATH') or
die('No direct script access.');
//-- Environment setup --------------------------------------------------------
/**
* Set the default time zone.
*
* @see <a href="http://kohanaframework.org/guide/using.configuration" target="_blank">http://kohanaframework.org/guide/using.configuration</a>
* @see <a href="http://php.net/timezones" target="_blank">http://php.net/timezones</a>
*/
date_default_timezone_set('America/Chicago');
/**
* Set the default locale.
*
* @see <a href="http://kohanaframework.org/guide/using.configuration" target="_blank">http://kohanaframework.org/guide/using.configuration</a>
* @see <a href="http://php.net/setlocale" target="_blank">http://php.net/setlocale</a>
*/
/**
* Enable the Kohana auto-loader.
*
* @see <a href="http://kohanaframework.org/guide/using.autoloading" target="_blank">http://kohanaframework.org/guide/using.autoloading</a>
* @see <a href="http://php.net/spl_autoload_register" target="_blank">http://php.net/spl_autoload_register</a>
*/
spl_autoload_register
(array('Kohana', 'auto_load'));
/**
* Enable the Kohana auto-loader for unserialization.
*
* @see <a href="http://php.net/spl_autoload_call" target="_blank">http://php.net/spl_autoload_call</a>
* @see <a href="http://php.net/manual/var.configuration.php#unserialize-callback-func" target="_blank">http://php.net/manual/var.configuration.ph...e-callback-func</a>
*/
ini_set('unserialize_callback_func', 'spl_autoload_call');
//-- Configuration and initialization -----------------------------------------
/**
* Initialize Kohana, setting the default options.
*
* The following options are available:
*
* - string base_url path, and optionally domain, of your application NULL
* - string index_file name of your index file, usually "index.php" index.php
* - string charset internal character set used for input and output utf-8
* - string cache_dir set the internal cache directory APPPATH/cache
* - boolean errors enable or disable error handling TRUE
* - boolean profile enable or disable internal profiling TRUE
* - boolean caching enable or disable internal caching FALSE
*/
'base_url' => '/',
'index_file' => FALSE,
));
/**
* Attach the file write to logging. Multiple writers are supported.
*/
Kohana::$log->attach(new Kohana_Log_File(APPPATH.'logs'));
/**
* Attach a file reader to config. Multiple readers are supported.
*/
Kohana::$config->attach(new Kohana_Config_File);
/**
* Enable modules. Modules are referenced by a relative or absolute path.
*/
// 'auth' => MODPATH.'auth', // Basic authentication
// 'cache' => MODPATH.'cache', // Caching with multiple backends
// 'codebench' => MODPATH.'codebench', // Benchmarking tool
// 'database' => MODPATH.'database', // Database access
// 'image' => MODPATH.'image', // Image manipulation
// 'orm' => MODPATH.'orm', // Object Relationship Mapping
// 'pagination' => MODPATH.'pagination', // Paging of results
// 'userguide' => MODPATH.'userguide', // User guide and API documentation
));
/**
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
Route::set('default', '(<controller>(/<action>(/<id>)))')
'controller' => 'welcome',
'action' => 'index',
));
/**
* Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
* If no source is specified, the URI will be automatically detected.
*/
->execute()
->send_headers()
->response;