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
https://forums.phpfreaks.com/topic/216118-mkdir-uid-safemode-problem/
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/

... 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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.