Jump to content

[SOLVED] Files not being included with set_include_path() or ini_set('include_path')


inVINCEable

Recommended Posts

I cannot seem to wrap my head around this peculiar problem. I have tried using both the function to set my include path, and then echo the get_included_files() and the files do not appear in the array. I can use require() or include() with no problems, but when I try to set the include path, the files do not seem to be included. Is there some weird quirck or gotcha to using this feature of PHP? I thought all you have to do is provide the directory and viola it should work. Any advice?

 

 

Thanks.

Just because the files are in your path does not meen they are included automatically. It just meens instead of typing the full path, you can use just the filename. ie:

 

<?php

  set_include_path(get_include_path(). ';' . '/foo/bar');
  include 'file.php';

?>

 

Instead of....

 

<?php

  include '/foo/bar/file.php';

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.