Reputation: 147
In the codeigniter installation guide here it says that for the best security the system and application folder should be set above web root. I kinda liked the idea so I gave it the shot.
In the byethost example it is in the same folder as the htdocs (I think)
I got the server path via the echo $_SERVER['DOCUMENT_ROOT']; So that mine is something like: /home/vol8/byethost17.com/my_username/htdocs
So i tried putting the path in index.php as
$application_folder = 'home/vol8/byethost17.com/my_username/application';
$system_path = 'home/vol8/byethost17.com/my_username/system';
But it didn't work
Your system folder path does not appear to be set correctly.
Please open the following file and correct this: index.php
Same with the application folder?
Can someone help me set this up properly?
EDIT:
Details:
Host php version: 5.3.14 Codeiniter: 2.1.3 Write premisions in root: rwxr-x--x
EDIT 2:
When I set
$application_folder = 'home/vol8/byethost17.com/my_username/htdocs/application';
$system_path = 'home/vol8/byethost17.com/my_username/htdocs/system';
it will work, meaning that it is probably the host who is not allowing this.
EDIT 3:
When I put
$system_path = dirname(__FILE__) . "/../system";
The page won't load and won't even display the error message.
Upvotes: 0
Views: 1638
Reputation: 10253
Setting path for CodeIgniter system and application folders that lie in a directory above of webroot can be achieved with following:
Move system
and application
folder above your webroot.
1.1 Some hosting providers do not allow this, so beware.
Open index.php
and change:
$system_folder = "system";
to
// if you are using pre-php5.3
$system_folder = dirname(__FILE__) . "/../system";
// if you are using php5.3
$system_folder = __DIR__ . "/../system";
depending on version of CodeIgniter.
3.1 For pre 2.0:
$application_folder = "application";
3.2 For 2.0+
$application_folder = '../application';
Upvotes: 3