gopher292
01-13-2006, 11:15 AM
Hello,
I'm trying to make a 4.x.x php script that outputs a file and have this code:<?php
$output="<html><head><title>test</title></head><body>test</body></html>";
file_put_contents("test.txt", $output);
function file_put_contents($file, $output) {
touch($file);
$handle=fopen($file, 'w');
fwrite($handle, $output);
fclose($handle);
}
?> But when I run it on my free php host I get the following error:
Warning: touch(): SAFE MODE Restriction in effect. The script whose uid is 502 is not allowed to access /vhost/usr/megasearch owned by uid 48 in /vhost/usr/megasearch/test.php on line 7
Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 502 is not allowed to access /vhost/usr/megasearch owned by uid 48 in /vhost/usr/megasearch/test.php on line 8
.
.
.
I don't have access to php.ini but I can change and add files with FTP.
How can I have the script run without the safe mode restrictions?
Is there a way that I can have the script run as "me" instead of as a script owned by me?
Thanks
I'm trying to make a 4.x.x php script that outputs a file and have this code:<?php
$output="<html><head><title>test</title></head><body>test</body></html>";
file_put_contents("test.txt", $output);
function file_put_contents($file, $output) {
touch($file);
$handle=fopen($file, 'w');
fwrite($handle, $output);
fclose($handle);
}
?> But when I run it on my free php host I get the following error:
Warning: touch(): SAFE MODE Restriction in effect. The script whose uid is 502 is not allowed to access /vhost/usr/megasearch owned by uid 48 in /vhost/usr/megasearch/test.php on line 7
Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 502 is not allowed to access /vhost/usr/megasearch owned by uid 48 in /vhost/usr/megasearch/test.php on line 8
.
.
.
I don't have access to php.ini but I can change and add files with FTP.
How can I have the script run without the safe mode restrictions?
Is there a way that I can have the script run as "me" instead of as a script owned by me?
Thanks