PmWiki.ResettingPagePermissions 2.9 KB

12345678
  1. version=pmwiki-0.5.25
  2. newline=²
  3. text=The following information appears after pressing "Save" on the Edit page:²²[[table bgcolor=silver]]²[[cellnr]]Warning: fopen("wiki.d/Main.HomePage", "w") - Permission denied in .../pmwiki.php on line 490 [[<<]][[<<]]²[[cellnr]]Warning: Cannot add header information - headers already sent by (output started at .../pmwiki.php:490) in .../pmwiki.php on line 287 [[<<]][[<<]]²[[cellnr]]PmWiki can't process your request [[<<]][[<<]]²[[cellnr]]Cannot write text to Main.HomePage (Main.HomePage) [[<<]][[<<]]²[[cellnr]]We are sorry for any inconvenience. ²[[tableend]]²²!Possible Cause²²When attempting to restore the wiki from a backup copy, the user copies wiki files to the wiki.d directory. The newly uploaded copies have an improper permission or owner. For example, if the user's name on a system is "qwerty", the uploaded files' owner will be "qwerty".²²'''Note:''' Files created by PmWiki have permissions of 664 (-rw-rw-r--) and usually owner "www", the web server. The web server may run under a different name, such as "nobody".²²!Solutions²²The best solution is to reset the newly uploaded files' owner. This may be done by running the unix @@chown@@ command, but only superusers have access to this. Here are some other options:²²'''Solution #1.'''²²Write a restore script that will run from the web server to copy the files from your old wiki.d directory into your new one. This will copy the files from oldwiki.d to wiki.d, but the new files will be owned by www and have the correct permissions. To do this:²** rename your old wiki.d to oldwiki.d²** change permissions on your pmwiki directory to 2777²** write a php script as follows:² <?php² mkdir("wiki.d");² umask(002);² system("/bin/cp oldwiki.d/* wiki.d");² ?>²** put the script in your pmwiki directory and call it in a browser; it was successful if there were no results.²²If the file permissions also need to be set, write a script as follows:² <?php system("/bin/chmod 664 wiki.d/*"); ?>²Again, put the script in your pmwiki directory and call it in a browser; it was successful if there were no results. ²²'''Solution #2.'''²²You can rename wiki.d to oldwiki.d and then add it to the list of directories to be searched, and let PmWiki create and manage a new wiki.d directory. Just add: ²² $WikiLibDirs = array("wiki.d","oldwiki.d","wikilib.d");²²to local.php. This tells PmWiki to look in wiki.d, oldwiki.d, and wikilib.d when displaying a page. However, all of the edited pages will go in "wiki.d" (or whatever $WikiDir is set to).²²'''Solution #3.'''²²You could also copy your files directly into wikilib.d, but that directory is better reserved for the PmWiki distributions.²²'''Solution #4.'''²²Set the permissions on all of the restored wiki files to 777. There is a security risk here, and this is not the recommended solution.
  4. time=1072748553
  5. host=24.1.44.14
  6. agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
  7. rev=9
  8. post= Save