Reputation: 128827
I would like to install Kohana PHP framework. The site is on a shared web hotel. I have tried to follow the instructions on Kohana's website.
kohana
directoryapplication/bootstrap.php
...and here comes the problem. When I visit the site, this message is shown:No direct script access.
And I have no idea about what I should do. I haven't seen anything about this in the documentation. I have tried to give more rights to some of the files, but it's hard to know what to do. Anyone that has any suggestions?
Upvotes: 1
Views: 3116
Reputation: 47091
First, follow the instructions in install.php
.
If all of the mandatory options are in green, remove install.php
.
If you then see an error message instead of hello, world!
, open the file application/bootstrap.php
with your text editor and replace the value of base_url
with str_replace($_SERVER["DOCUMENT_ROOT"], '', getcwd()) . DIRECTORY_SEPARATOR
or whatever string
this code gives you.
Full code :
Kohana::init(
array(
'base_url' => str_replace($_SERVER["DOCUMENT_ROOT"], '', getcwd()) . DIRECTORY_SEPARATOR,
));
Upvotes: 0
Reputation: 1454
If you are running your app in subfolder under DocumenRoot (assuming you are using apache) you may need modify the .htaccess file
RewriteBase /your-app-folder-name
instead of
RewriteBase /
Upvotes: 0
Reputation: 11
You have to change the base URL in application/bootstrap.php
, for example:
Kohana::init(array(
'base_url' => '/here your base url or your project name /',
'index_file' => '',
));
After that, you have to change the name of the install file (or delete it).
Upvotes: 1
Reputation: 16682
According to the instructions, you are to open application/bootstrap.php
in your text editor to make the requested changes. Visiting it in your browser probably gives you that message, because at the top of Kohana files appear to be the line
defined('SYSPATH') or die('No direct script access.');
or something similar. This is used in many PHP projects to prevent hacking into a file that should only be included.
Upvotes: 4