Help | kohany.com

Help


Installation


  1. Download the latest version, and extract it onto your server.

  2. Now point your browser to base url / to test your environment and make sure all requirements are passed.

  3. You may need to make application/logs/ , application/cache/ and thumbnails/ folders writable. Using an ftp client you can usually right-click on each folder, click on permisions, and mark as group and world writable. If you have command-line access you can run the following commands:

    chmod 777 application/logs/
    chmod 777 application/cache/
    chmod 777 thumbnails/

    Now you should rename or remove install.php to something like _installed.php at root directory.

  4. You will need to create a database, and a database user with access to that database, and then edit application/config/database.php with those settings. Here is the relevant pieces of that file:

    'hostname' => 'localhost',
    'username' => 'PUT USERNAME HERE',
    'password' => 'PUT PASSWORD HERE',
    'persistent' => FALSE,
    'database' => 'PUT DATABASE HERE',
  5. At the next step enter email, password for the user admin and secret key for remote access, after that click Install. If you get no errors, then Kohany is installed!

  6. For security, you should remove or rename application/classes/controllers/install.php to something like application/classes/controllers/_installed.php and install.sql to something like _installed.sql .


Putting Kohany in a subfolder*


If Kohany is not in the root of the server we need to change some files. Lets say we are putting Kohany in a subfolder called subfolder.

In .htaccess 

RewriteBase /
## change to ##
RewriteBase /subfolder

In application/bootstrap.php 

'base_url' => '/',
## change to ##
'base_url' => '/subfolder',

*If you put Kohany in a subfolder, the links on all your pages will probably be broken.


PHP 5.6


In index.php 

error_reporting(E_ALL | E_STRICT);
## change to ##
error_reporting(E_ALL & ~E_DEPRECATED);

Nginx


server {
    listen      80;
    server_name example.com;
    set         $root_path '/path/to/kohany';
    root        $root_path;

    access_log  /var/log/nginx/ko-access.log;
    error_log   /var/log/nginx/ko-error.log;

    index index.php index.html index.htm;

    try_files $uri $uri/ @rewrite;

    location @rewrite {
        rewrite ^/(.*)$ /index.php/$1;
    }

    location ~ \.php {
        fastcgi_index  /index.php;
        fastcgi_pass   127.0.0.1:9000;

        include fastcgi_params;
        fastcgi_split_path_info       ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO       $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~* ^/(css|fonts|img|js|min)/(.+)$ {
        root $root_path;
    }

    location ~ /\.ht {
        deny all;
    }
}

After installation


  1. Log in as admin user and go to admin panel /admin .

  2. In Settings » General set your Web address and other options such as title, description.

  3. In Settings » Payments set payment methods and data such as username, password.

  4. In Settings » E-mail set how to send emails and admin email.

  5. In Settings » Adverts enter your own advertising codes.

  6. Follow Settings » Cron to set cron jobs.

  7. In Groups » Show edit groups parameters such as price, days, min Page Rank.


Development


All official development is by the Kohany Team and tracked on our developer site.

If you want to report a bug, translation or make a features request, follow issues link.


Update


Typically, you only need change the folder application/ . Before the update, it is recommended to make a backup copy of your database and files.

  1. Make a copy of database config application/config/database.php .

  2. Copy the files that have been modified by you, eg from the folders application/views/ , themes/your_template , themes/default/headers .

  3. Delete old and copy new or overwrite the folder application/ .

  4. Remove file application/classes/controller/install.php .

  5. Restore database config file.

Requirements