• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Autoload error

#1
[eluser]dorwin[/eluser]
Hello,

I have an autoload error : Unable to load the requested file: helpers/html_helper.php

Actually I changed some file disposition :

My system folder :

/libraries/codeigniter/system

And application folder :

/a_folder/whooper/application

I have in my index.php :

Code:
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1')
    define ('LOCAL', true);
else
    define ('LOCAL', false);
    
$path = (LOCAL)?'C:\wamp\www\librairies\codeigniter':'/usr/home/v1076';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

$system_folder = "/system";
CI seems to working fine, I have welcome message, but when I put some autoload stuff like :
Code:
$autoload['libraries'] = array('database', 'parser');
$autoload['helper'] = array('html', 'url');

I have the error. I notice CI looking for theses files on application/helpers folder and not system folder...

Do you know what is wrong ?

Thanks Smile !

#2
[eluser]WanWizard[/eluser]
CI doesn't need an include path, so you can get rid of that.

What does your docroot look like? Are those two paths relative to your docroot? Or to something else? Where is your index.php in that stucture?

In general, when you change the directory structure of a CodeIgniter installation, set the system- and applications folder in index.php to a full path, instead of a relative path, to avoid issues like this.

#3
[eluser]dorwin[/eluser]
If I dont put include_path I have error :
Code:
Warning: require_once(/system/codeigniter/CodeIgniter.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\francebay\whooper\index.php on line 121

Fatal error: require_once() [function.require]: Failed opening required '/system/codeigniter/CodeIgniter.php' (include_path='.;C:\php5\pear;') in C:\wamp\www\francebay\whooper\index.php on line 121

There is a screen of my folder disposition : http://yfrog.com/9efoldersp

index.php :
Code:
$system_folder = "/system";
$application_folder = "application";
//i tryed
$application_folder = "../../francebay/whooper/application";
//same error

#4
[eluser]WanWizard[/eluser]
So it should be
Code:
$system_folder = "/wamp/www/libraries/codeigniter/system";
// or
$system_folder = "../../libraries/codeigniter/system";
// paths are relative to the location of index.php!
$application_folder = "application";

That also means that your URL is http://website/francebay/whooper/index.php. Make sure you have a rewritebase in your .htaccess, if you need to rewrite the URL to get rid of the index.php part.

#5
[eluser]dorwin[/eluser]
Ok Thanks for indication,

actually it was

Code:
$system_folder = "C:\wamp\www\librairies\codeigniter\system";

//and removing this :

/*
if (strpos($system_folder, '/') === FALSE)
{
    if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
    {
        $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
    }
}
else
{
    // Swap directory separators to Unix style for consistency
    $system_folder = str_replace("\\", "/", $system_folder);
}
*/

I guess on production it will be /usr/home/v1076/libraries/codeigniter/system or something like that, you were right, include path is useless Wink

thanks and bye Smile

#6
[eluser]WanWizard[/eluser]
So the driveletter is required?

I have no Windows experience (who wants to use that as a production server?), but it's good to know.

#7
[eluser]dorwin[/eluser]
Yep, windows is entertainment Wink I like it for dev :p


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.