Problem with pointers / permissions?
-
So I'm writing an index page that calls a header file within a different folder. The pages that seem to not work are the index pages WITHIN other folders and using ../ to get back to the root folder and back into the include folder, if the pages are within the root folder and call the header by going through the include folder, it works. Kind of hard to explain.. But I'm getting these errors..
Warning: main(paul\_menubar\_test/menubar\_test\_filesavail.php) \[function.main\]: failed to open stream: No such file or directory in /home/new2/include/headers.php on line 190
Warning: main() [function.include]: Failed opening 'paul_menubar_test/menubar_test_filesavail.php' for inclusion (include_path='.:/usr/php4/lib/php') in /home/new2/include/headers.php on line 190
And that's an index file that's within a different folder in the root folder. I have an index file in the root folder that does the call for the include/header and it works. If you need any clarification, please ask.. I don't know how else to word it. I've checked google and people just say "lol check ur pointers," I did, like a 100 times. I've tried all sorts of "/," "../" and all that. I've also read that I may need to change the permissions of the folder or something? I'm not sure how to do that.. but the other problem is every single page calls the FOOTER file, which is also in the "include folder," has no problem. -Paul
-
So I'm writing an index page that calls a header file within a different folder. The pages that seem to not work are the index pages WITHIN other folders and using ../ to get back to the root folder and back into the include folder, if the pages are within the root folder and call the header by going through the include folder, it works. Kind of hard to explain.. But I'm getting these errors..
Warning: main(paul\_menubar\_test/menubar\_test\_filesavail.php) \[function.main\]: failed to open stream: No such file or directory in /home/new2/include/headers.php on line 190
Warning: main() [function.include]: Failed opening 'paul_menubar_test/menubar_test_filesavail.php' for inclusion (include_path='.:/usr/php4/lib/php') in /home/new2/include/headers.php on line 190
And that's an index file that's within a different folder in the root folder. I have an index file in the root folder that does the call for the include/header and it works. If you need any clarification, please ask.. I don't know how else to word it. I've checked google and people just say "lol check ur pointers," I did, like a 100 times. I've tried all sorts of "/," "../" and all that. I've also read that I may need to change the permissions of the folder or something? I'm not sure how to do that.. but the other problem is every single page calls the FOOTER file, which is also in the "include folder," has no problem. -Paul
lol, check your pointers! just kidding :) can you give an example of the file structure and explain how pages are called from one to the next? I have an idea you may have an issue related to your includes as it pertains to the current local directory and the use of relative paths.
Chris J www.redash.org
-
So I'm writing an index page that calls a header file within a different folder. The pages that seem to not work are the index pages WITHIN other folders and using ../ to get back to the root folder and back into the include folder, if the pages are within the root folder and call the header by going through the include folder, it works. Kind of hard to explain.. But I'm getting these errors..
Warning: main(paul\_menubar\_test/menubar\_test\_filesavail.php) \[function.main\]: failed to open stream: No such file or directory in /home/new2/include/headers.php on line 190
Warning: main() [function.include]: Failed opening 'paul_menubar_test/menubar_test_filesavail.php' for inclusion (include_path='.:/usr/php4/lib/php') in /home/new2/include/headers.php on line 190
And that's an index file that's within a different folder in the root folder. I have an index file in the root folder that does the call for the include/header and it works. If you need any clarification, please ask.. I don't know how else to word it. I've checked google and people just say "lol check ur pointers," I did, like a 100 times. I've tried all sorts of "/," "../" and all that. I've also read that I may need to change the permissions of the folder or something? I'm not sure how to do that.. but the other problem is every single page calls the FOOTER file, which is also in the "include folder," has no problem. -Paul
if you include other files, the relative path back to root is from the first file. so if page A is /A/index.php, which does a require_once('B/header.php') (in other words requires /A/B/header.php), then if /A/B/header.php wants to require_once /C/D/miniheader.php it needs to
require_once('../C/D/miniheader.php');
i.e. only one folder up (all the requires are relative to /A/index.php, the first script that ran)
-
So I'm writing an index page that calls a header file within a different folder. The pages that seem to not work are the index pages WITHIN other folders and using ../ to get back to the root folder and back into the include folder, if the pages are within the root folder and call the header by going through the include folder, it works. Kind of hard to explain.. But I'm getting these errors..
Warning: main(paul\_menubar\_test/menubar\_test\_filesavail.php) \[function.main\]: failed to open stream: No such file or directory in /home/new2/include/headers.php on line 190
Warning: main() [function.include]: Failed opening 'paul_menubar_test/menubar_test_filesavail.php' for inclusion (include_path='.:/usr/php4/lib/php') in /home/new2/include/headers.php on line 190
And that's an index file that's within a different folder in the root folder. I have an index file in the root folder that does the call for the include/header and it works. If you need any clarification, please ask.. I don't know how else to word it. I've checked google and people just say "lol check ur pointers," I did, like a 100 times. I've tried all sorts of "/," "../" and all that. I've also read that I may need to change the permissions of the folder or something? I'm not sure how to do that.. but the other problem is every single page calls the FOOTER file, which is also in the "include folder," has no problem. -Paul
if it is in the root of the site try "{$_SERVER['DOCUMENT_ROOT]}/paul_menubar_test/menubar_test_filesavail.php";