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.
some problem with the include_path
Moderator: General Moderators
-
padrinoent
- Forum Newbie
- Posts: 3
- Joined: Thu Jan 01, 2004 6:35 am
"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?
If you...
Code: Select all
<?php
include 'foo.bar';
?>Really verified that the file you are including really is where the script thinks it should be?
-
padrinoent
- Forum Newbie
- Posts: 3
- Joined: Thu Jan 01, 2004 6:35 am
I've this problem when I use multiple inclusion:
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
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
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.
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
/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.phpHope I didn't make a complete fool out of myself