Permission Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Antitrust
Forum Newbie
Posts: 11
Joined: Tue Jan 28, 2003 10:15 am
Location: Canada
Contact:

Permission Problem

Post by Antitrust »

When a user uploads a gallery, a new directory is created using the mkdir() command. After that, I am [trying] to upload each file that they want in the gallery to that directory. This is all being executed in the same run by the same script. I use move_uploaded_file() to move each uploaded file to the folder.

Here's the problem: I am getting a UID error with Safe Mode on - this is a must. Here's the error:
SAFE MODE Restriction in effect. The script whose uid is 512 is not allowed to access [folder info removed] owned by uid 48 in [script info removed] on line 94
The permissions of the folder created are 0755. Does anyone know of a fix here? Or any ideas?

Thanks in advance.
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

As a guess, if your using Apache then you need to chown the directories you create to the same user as the Apache process.

It's not PHP that writes the file to the directory it's the Apache process, you could chown the dir's to 777, which may fix your issue.
Post Reply