File Permission Denied fopen
I use MS Expressions for creating and publishing sites. I also have a quick page editor built in to my CMS. If I edit the page with my CMS I can no longer edit it with Expressions. I get a file permission error.
Before I save the new info I delete the old page and create a new one. I then give it 0777 permission. Any suggestions?
The page saves fine and shows the 开发者_如何学运维correct permission in my Cpanel
$ourFileName =(DOCROOT."/template/$myTemplate/$myFile");
$page_content = stripslashes("$page_content");
unlink("$ourFileName");
$ourFileHandle = fopen($ourFileName, 'a+') or die("can't open file");
fwrite($ourFileHandle,"$page_content");
fclose($ourFileHandle);
chmod("$ourFileName", 0755);
}
You have to be sure that you have correct permissions on directories, too. (757)
精彩评论