I've read somewhere that by default php creates files with ownership taken from the owner of apache. This solution is hosted so would I need to request the Host to alter the php configuration of default files or is it possible for me to get around this by adding a .htaccess file with appropriate permissions in the folder where these files are created?!?!
To give you an idea of what i'm doing here's some of my GD lib php code:-
Code: Select all
$path = "/home/rhtest/public_html/dynsig/images/signatures/";
$image_name = $pfuser. ".png";
$fpath = $path.$image_name;
if(($handle = fopen($fpath,'w+b')) === FALSE){
die('Failed to open file for writing!');
} else {
chown($fpath, "rhtest");
chmod($fpath, 0777);
fwrite($handle, $im);
fclose($handle);
//imagepng($im, $fpath,0,NULL);
@imagecreatefrompng($fpath);
imagepng($im);
imagedestroy($im);
}