Page 1 of 1
some problem with the include_path
Posted: Thu Jan 01, 2004 6:35 am
by padrinoent
I've installed a Red Hat Enterprise in a separate pc. Now I'm working via ftp and ssh. All is right, but I've a problem with "inclusion": when I use "include" or "require", some times I receive this message:
Warning: Failed opening 'charset.php' for inclusion (include_path='.:/php/includes:/usr/share/php')
the posizion is right, I think I must configure the php.ini to resolve this problem, but I can't understand how.
tahnks.
Posted: Thu Jan 01, 2004 9:28 am
by JAM
"Sometimes" as in sometimes using the same script/page or is it different scripts/pages you are trying to view when the error occurs?
If you...
...and it's not found in the current directory, it looks for that in the auto include dir stated in php.ini (include_path = ...)
Really verified that the file you are including really is where the script thinks it should be?
Posted: Thu Jan 01, 2004 12:50 pm
by padrinoent
I've this problem when I use multiple inclusion:
Code: Select all
index.php
<?php
include 'page1.php';
?>
Code: Select all
page1.php
<?php
include 'page/page2.php';
?>
Code: Select all
page3.php
<?php
include 'page3/page3.php';
?>
at least the server can't find the page (the name is correct). When is enable the "include_path = "./php/includes:usr/share/php",
the server said me that it can't find the page with include, and show me the path instruction. If I disable the "inclusion_path", it
said me that can't open the file beacause "include_path='.:/usr/share/pear'". Now I must find where i must change the configuration to set
the server to open the file that i want to open.
thanks for you help
Posted: Thu Jan 01, 2004 4:25 pm
by JAM
Sorry for being stubborn

but are you sure you didn't miss something?
/index.php
/page1.php
/page/page2.php
/page/page3/page3.php
This is were your scripts try to find your pages. If including a page, you must consider the path of the file you are including FROM, so to speak.
Code: Select all
// We are here: http://example.com/folder/folder/index.php
include '/page.php';
// http://example.com/page.php
include 'page.php';
// http://example.com/folder/folder/page.php
The 'include_path' error is something that the php parser spits out to show you that there is an error, and if you are not using auto includes you should not worry about it (trying to disable it) at this point. My bet is that the issue is in how you think you placed the files...
Hope I didn't make a complete fool out of myself
