TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Configuration kohana-projecttemplate
  • Hi all,

    I'm trying to configure the kohana-projecttemplate from synapsestudios.

    My project folder is located on /www/kohana/

    I want the website works on http://localhost/kohana (obviously, i have others projects here)

    The problem is about the httpdocs folder (/www/kohana/httpdocs), seems to be like a ghost folder.

    What king of configuration i need ?

    httpd.conf ? A .htaccess in my root project ?

    Thank you so much for your help.


    FILE: \www\kohana\application\config\environments\development\init.php return array( // @TODO: change this to be project-specific 'base_url' => 'http://localhost/kohana/', 'index_file' => '',

    FILE: \wamp\www\kohana\httpdocs.htaccess (file given) RewriteCond %{HTTP_HOST} ^localhost$ RewriteRule .* - [E=REWRITEBASE:/]

  • instead of rewrite rule, try to use softlinks

    take a look at my folder structure in readme.md https://github.com/BlackScorp/application

    i have a public folder with files which are allowed to be viewn from document root. my complete applicaitons are stored at home/username/kohana/applications

    with ln -s you point the public folder into www/htdocs and thats it;)

  • Thank you !

  • @BlackScorp Why do you symlink the folders into the document root? Why not just modify index.php to go one level up like $application = '../application';, $modules = '../modules';, $system = '../system';

    This way the users can't access directly the folders / files. Especially if you forget it on 0x777 :)

    Also, you don't have to put this line defined('SYSPATH') OR die('No direct script access.'); in every file if you move the folders out from the document root and leave only the public files, like index.php and other public assets.

  • @feketegy

    the reason is that its easier to for me to have a fix folder structure on my local PC and my server. i dont want to modify everytime the index.php i just want to have a fixed folder structure anywhere. i also dont want to have for each application an own kohana core classes. but i just symlink the public folder into htdocs not the application folder.

    and yes i dont need the defined('SYSPATH') since the files are not in document root, but iam trying to use kohana as clear as possible. currently all kohana files have this in first line, so iam just adding it.

  • @ BlackScorp You can symlink it one level up outside the document root. I think it's much safer that way...

  • @feketegy

    but this will not work. if you take a look at my application, i symlink only https://github.com/BlackScorp/application/tree/3.3/master/public this folder. my kohana folder with modules and system etc are in my home folder. if i look at my /var/www/htdocs it is full of links which contains just the index.php and stuff my document root has no real php files

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion