Jump to content

mkdir uid safemode problem


Oziam

Recommended Posts

Hope someone can help me!

I have an upload script that stores users files, it creates a dir using the users name which will store their uploads!

The problem is because I am on a shared host with safe mode ON i get an error when trying to upload to that directory via a form, the error says something like

SAFE MODE Restriction in effect. The script whose uid is 500 is not allowed to access /proc/uptime owned by uid 0 in ......

 

If I create a dir manually(FTP) it works fine! But I cannot obviously create a dir for each new user as the registration is automatic, so at the moment I have 1 common dir for all users to upload to, but this will eventually cause too much congestion and slow things down!

 

Any ideas! Thanks!!

Link to comment
Share on other sites

Yes I do chmod the dir! my code is similar to below;

 

if (!is_dir($this->dir)){

mkdir($this->dir);

chmod($this->dir, 0777);

}

 

I have also tried; mkdir($this->dir, 0777); mkdir($this->dir, 1777); mkdir($this->dir, 4777);

 

and

 

if (!is_dir($this->dir)){

$oldumask = umask(0);

mkdir($this->dir, 0777);

umask($oldumask);

}

 

and I have even tried to change the uid to nobody!

 

posix_setgid(99);

posix_setuid(99);

 

also the dir is created inside the root e.g

 

root/usr_img/username/

Link to comment
Share on other sites

... The script whose uid is 500 is not allowed to access /proc/uptime owned by uid 0 in ......

 

Are you sure that you are specifying the directory name correctly?  That error message indicates you are trying to access /proc/uptime which is owned by root.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.