Re: safe_mode_include_dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



    Tony,

    Calm down.  It may take us 21 minutes to respond sometimes, but we
will.  No need to repost.  ;-P

On Dec 12, 2007 3:26 PM, Tony Beyers <nigelmas@xxxxxxxxx> wrote:
> I'm running php 5.2.5 with these settings in a virtualhost block in
> apache 2.0.61:
>         php_admin_flag safe_mode on
>         php_admin_value include_path "/afs/msu.edu/.../web"
>         php_admin_value safe_mode_include_dir "/afs/msu.edu/.../web"
> I've got an index.php file in web/support/ that does a
> require_once("../includes/support.php");

    Is there a specific reason you're using require_once() instead of
include_once() ?  There actually is a difference.... include() and
include_once() will only include the file if that line of code is
executed, whereas require() and require_once() will include the file
even if the line is inside of an if() {} block for which the
condition(s) are never matched.

> Being in afs with write access from multiple people, the uids of the
> files do not match and I get an error stating that. So I put the
> safe_mode_include_dir line above in but it did not fix the problem
> until I used the absolute path in the require_once line.
> Is there a way to include files with relative paths?

    Of course there is.  For example, say you're in a laterally-equal
directory as one from which you want to include a file.

    <? include('../otherdir/file.php'); ?>

    As long as you have permissions to read the files, you're good to
go.  My guess is that you may have done the relative linking
improperly.  Is the file actually `web/includes/support.php` called
from `web/index.php`?

    The other thing I would suggest is making sure your target include
directory is a real directory and not a symlinked directory.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux