ignite1688846
ignite1688846

Reputation: 147

Codeigniter: Installation problems with remote system and app folders on byethost

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

Answers (1)

Artem L
Artem L

Reputation: 10253

Setting path for CodeIgniter system and application folders that lie in a directory above of webroot can be achieved with following:

  1. Move system and application folder above your webroot.

    1.1 Some hosting providers do not allow this, so beware.

  2. 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";
    
  3. depending on version of CodeIgniter.

    3.1 For pre 2.0:

    $application_folder = "application";
    

    3.2 For 2.0+

    $application_folder = '../application';
    

Upvotes: 3

Related Questions