Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my local environment, the following settings work in my index.php file:

$system_path = '../../ci/system/';
$application_folder = '../../ci/application';

My folder structure looks like this:



This works on my local environment, but when I upload my files, I get an error message:

Your system folder path does not appear to be set correctly. 
Please open the following file and correct this: index.php

I tried the following:

$system_path = dirname(__FILE__).'../../ci/system/';
$application_folder = dirname(__FILE__).'../../ci/application';
share|improve this question
May I ask Why do you need such arrangement? – Khaled Mar 21 '12 at 8:23
Not sure this can be done on shared hosting since public_html will be set by default for security. – Errol Fitzgerald Mar 25 '12 at 10:45
@khaled it's the recommended setup for the framework I am certain folders such as /system/ and /application/ are harder to access – redconservatory Mar 26 '12 at 23:44
@Errol I seemed to be able to do this via symlinking in php so I guess that was the solution – redconservatory Mar 26 '12 at 23:44

The site I am using is with hostgator and the following worked:

In, put

<?php symlink('/home/username/ci/system', '/home/username/public_html/system'); ?>
<?php symlink('/home/username/ci/application', '/home/username/public_html/application'); ?>

Then visit in your browser. If the screen is blank, it worked (the symlinks are created)

Then, in your configuration file (for me it's index.php), change the links as if they were in public_html:

$system_path = 'system';
$application_folder = 'application';
share|improve this answer

There is a problem with dirname(FILE) - there is no ending / return by dirname, therefore you have to add it:

include dirname(__FILE__) . '/../../smthng.php';

or even better:

include __DIR__ . '/../../smthng.php';
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.