CHmod og FPUTs
jeg vil lave en html form hvor man kan ændre så det er nemt at lave en config fil.. MEN jeg har lidt problemer..1) jeg skal lave en fil der hedder config.inc
2) jeg skal ændre chmod på upload biblioteket (et man selv laver) til 0755
3) $LEXT skal være et array..
min php fil ser sådan ud (jeg har en form hvor data står i)
[makeconfig.php]
<?php
$sb = $sizeMbyte*1048576;
$path = getcwd();
chmod("upload", 0755);
$config = "<?php
$websiteurl = $url;
$websitename = $name;
$absolute_path = $path;
$dl = $path.'/upload/';
$sizelimit = $limit; $sizebytes = $sb;
$extlimit = $ext; $limitedext = array($lext); ?>";
$fp = fopen("config.inc","w"); //åbner fil, sletter og retter
fputs($fp,"$config");
fclose($fp); //filen lukkes
?>
Når jeg kører filen får jeg følgende:
Warning: chmod(): Operation not permitted in /home/domain/public_html/test/makeconfig.php on line 4
test
Warning: fopen(config.inc): failed to open stream: Permission denied in /home/domain/public_html/test/makeconfig.php on line 19
Warning: fputs(): supplied argument is not a valid stream resource in /home/domain/public_html/test/makeconfig.php on line 20
Warning: fclose(): supplied argument is not a valid stream resource in /home/domain/public_html/test/makeconfig.php on line 21
