Thomas Lindgaard wrote:
> Hejsa
>
> Jeg har spurgt om det her tidligere men har ikke fået løst problemet -
> det er:
>
> Brugere skal have lov til at uploade filer til serveren. Når en bruger
> bliver oprettet, bliver der samtidig lavet en folder på serveren som
> brugerens filer vil blive lagt i. Denne folder bliver chmod'et til 777,
> så det i hvert fald ikke er dér det går galt.
>
> Upload-siden gør efterfølgende:
>
> copy($_FILES['file']['tmp_name'], <ny folder>/<nyt navn>);
>
> men så får jeg meldingen
>
> Warning: copy(): SAFE MODE Restriction in effect. The script whose uid
> is 4425 is not allowed to access <ny folder> owned by uid 13 in
> upload.php on line 52
>
RTFM:
"When safe_mode is on, PHP checks to see if the owner of the current
script matches the owner of the file to be operated on by a file
function. For example:
-rw-rw-r-- 1 rasmus rasmus 33 Jul 1 19:20 script.php
-rw-r--r-- 1 root root 1116 May 26 18:01 /etc/passwd
Running this script.php
<?php
readfile('/etc/passwd');
?>
results in this error when safe mode is enabled:
Warning: SAFE MODE Restriction in effect. The script whose uid is 500 is
not
allowed to access /etc/passwd owned by uid 0 in /docroot/script.php on
line 2
However, there may be environments where a strict UID check is not
appropriate and a relaxed GID check is sufficient. This is supported by
means of the safe_mode_gid switch. Setting it to On performs the relaxed
GID checking, setting it to Off (the default) performs UID checking. "
--
http://dk.php.net/features.safe-mode
MVH Per Thomsen,
http://www.pert.dk/