• Resolved ratbastid

    (@ratbastid)


    I have a plugin that takes uploaded files via HTTP post, creates a random directory name for them, and moves them into that directory.

    My PHP script runs as a user called “newtgp”, with a UID of 10006. But my directory gets created by the user “apache”. So when I use move_uploaded_file(), I get:

    Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 10006 is not allowed to access /[redacted]/64c9ac2bb5fe46c3ac32844bb97be6bc owned by uid 48 in /[redacted]/wp-content/plugins/SocialPhoto.php on line 95

    I know this is more a general PHP question than a WordPress question, but still… Somebody around her must have a suggestion for me. How can I make my mkdir() and my move_uploaded_file() run with the same userid? I tried using rename() instead of move_uploaded_file() and got the same error.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Directory/file creation problem’ is closed to new replies.