Forum Moderators: coopster

Message Too Old, No Replies

PHP/Apache & fopen() HELP!

         

angst

2:46 pm on Sep 12, 2005 (gmt 0)

10+ Year Member



Hello,
I'm trying to using fopen() on my web hosts server thats running in SAFEMODE. and I'm having major issues!

simple script for testing:
[php]
<?
$oldumask = umask(0);
mkdir ('test',0777);
chown('test',intval(10003));
fopen('test/index_test.php',"x");

umask($oldumask);
?>
[/php]

ok so,
mkdir works, and fopen works too, but only is i'm creating a file in the same folder as the script, if I try to creat a file/folder within the newly created folder 'test' i get this error:

Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 10003 is not allowed to access /test owned by uid 33 in /mkdir.php on line 5,

si I tried using chown() to see if I can set the uid, but thats restricted too.

does anyone know of a way around this problem? or am I screwed on this one?

thanks in advance for your time!
-Ken

jatar_k

4:12 pm on Sep 13, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't think there is a way around this actually.

I think a different approach is probably the best way.