Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Problem with pointers / permissions?

Problem with pointers / permissions?

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
phpdatabasehelptutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    whatsa
    wrote on last edited by
    #1

    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

    C E N 3 Replies Last reply
    0
    • W whatsa

      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

      C Offline
      C Offline
      cjoki
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • W whatsa

        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

        E Offline
        E Offline
        effayqueue
        wrote on last edited by
        #3

        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)

        1 Reply Last reply
        0
        • W whatsa

          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

          N Offline
          N Offline
          nickmaroulis
          wrote on last edited by
          #4

          if it is in the root of the site try "{$_SERVER['DOCUMENT_ROOT]}/paul_menubar_test/menubar_test_filesavail.php";

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups