简体   繁体   中英

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM