« Previous Next »

Thread: Php does not open files that are absolute

Last post 06-04-2009 6:17 AM by andrewkillen. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 04-22-2009, 9:16 AM

    Php does not open files that are absolute

    Hey all,

    I really need some help getting to the bottom of this problem.  I've used the MS beta web installer to get FastCGI PHP 5.2.9 onto my new Vista home premium machine.  And since installing I've had many problems with php scripts that I have created and have out in the wild.

    Basically it seems to be a directory/file IO issue. 

    1. require once

    If I use requre_once in any other way than "file.php" or "./file.php", ie "/include/stuff/file.php" or ($docroot."/include/stuff/file.php), Require_once cannot open the file or directory

    here is the error detail

    PHP Warning:  require_once(/dieet/include/php/basepage.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in C:\Users\Andy\sites\dieet-4u\dieet\index.php on line 10
    PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/dieet/include/php/basepage.php' (include_path='.;C:\php5\pear') in C:\Users\Andy\sites\dieet-4u\dieet\index.php on line 10

    Please help!  I need to get to the bottom of this... so any advice will be very greatfully recieved
    thanks in advance

    Andy

  • 04-25-2009, 11:20 AM In reply to

    Re: Php does not open files that are absolute

    how about $_SERVER['DOCUMENT_ROOT'] . "/yourdirectory/yourfile.php"

    the above works for me..  include_once takes relative or absolute paths... so that should work... let me know...

    Regards,
    MA Khan
    http://www.iisworkstation.com

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 06-04-2009, 6:17 AM In reply to

    Re: Php does not open files that are absolute

     many thanks, you were right.  appologies for the late reply, over-active spam filter..

Page 1 of 1 (3 items)
Microsoft Communities