tags:

views:

180

answers:

4

My PHP files are not able to call the include function anymore. I suppose my hosting changed php settings. Is there any workaround to this problem? Can I enable the include function in php.ini/.htaccess files? How? My host is using PHP version 4.4.9.

EDIT - All the files that I am trying to include are local files and not files on another server. The include functions were working fine until a few days back. They have suddenly stopped working.

+2  A: 

i think is permission problem,

do you see error in error log file ,

or see error in the screen ?

Haim Evgi
A: 

Maybe your host changed the path to your www.

Are you using relative or absolute paths in your include()?

altermativ
I am using relative paths.
Gaurav
the file that I need to include is in the same directory as the file calling it.
Gaurav
+1  A: 

What does your php.log say?

Visage
Looking in log files is frowned up now?
Visage
A: 

This looks and feels wrong, but could this work?

function includeFile($path) {

    if (!file_exists($path)) {
        return false;
    }

    $contents = file_get_contents($path);

    eval($contents); // ewww
    return true;

}
alex
I agree, gross.
Andrew Dunkman
Might be worth a try strictly for testing purposes.. but this type of code should never touch production.
Mike B
PS: if $path is a url, it will be eval()ed already so the second eval() could produce unexpected results.
Mike B
Yeah I realise it's awful, but it's worth a *try*. Though I'd hate to see this make production (I'd be getting include/require enabled again)
alex