1 If you cannot run PhpWiki on top of a relational database like
2 MySQL or Postgresql, and your system does not support DBM files
3 or (worse) has a broken implementation like NDBM on Solaris, then
4 a flat file Wiki should work for you. Note that as of 1.2 most of the
5 Wiki functionality is there... the MostPopular is not implemented yet
6 so you will want to delete that link from the FrontPage (or better
7 yet, write it and mail us a patch ;-)
9 Installation is similar to using a DBM file for storing the pages.
10 You should read the main INSTALL file before this one (it's not long
11 and complicated so go ahead and we'll wait for you right here).
13 First, edit lib/config.php and set the database to "file":
15 $WhichDatabase = 'file'; // use one of "dbm", "mysql", "pgsql", "msql",
19 Now, the key thing is you need a directory that the web server can
20 read and write to. This is where it will store current and archived
23 If you have root access the next section applies to you. If you don't
24 have root access, skip down to the section "I DON'T HAVE ROOT ACCESS"
25 to see what options you have.
27 Choose where you want to have the pages stored; on my system I put
28 them in a directory under the PhpWiki root directory. That is, I
29 installed my PhpWiki in /home/swain/public_html/flatfiletest/phpwiki.
30 I created a directory called "pages" like this:
32 [root@localhost phpwiki]# mkdir pages
34 This creates a new directory:
36 [swain@localhost phpwiki]$ ls -l
38 -rw-r--r-- 1 swain swain 1776 Dec 22 16:10 CREDITS
39 -rw-r--r-- 1 swain swain 6323 Dec 12 16:53 DBLIB.txt
40 -rw-r--r-- 1 swain swain 10373 Nov 5 22:19 HISTORY
41 -rw-r--r-- 1 swain swain 3241 Oct 8 15:08 INSTALL
42 -rw-r--r-- 1 swain swain 1241 Oct 8 14:12 INSTALL.mSQL
43 -rw-r--r-- 1 swain swain 1584 Oct 8 14:12 INSTALL.mysql
44 -rw-r--r-- 1 swain swain 2001 Oct 8 15:19 INSTALL.pgsql
45 -rw-r--r-- 1 swain swain 18106 Jun 2 2000 LICENSE
46 -rw-r--r-- 1 swain swain 2873 Dec 12 16:24 README
47 drwxrwxr-x 2 swain swain 1024 Jan 1 18:46 admin
48 -rw-r--r-- 1 swain swain 2366 Nov 13 05:59 admin.php
49 drwxrwxr-x 2 swain swain 1024 Jan 1 18:46 images
50 -rw-r--r-- 1 swain swain 1305 Nov 8 10:34 index.php
51 drwxrwxr-x 2 swain swain 1024 Jan 3 22:44 lib
52 drwxrwxr-x 6 swain swain 1024 Jan 1 18:46 locale
53 drwxrwxr-x 4 swain swain 1024 Jan 1 18:50 pages
54 drwxrwxr-x 2 swain swain 1024 Jan 1 18:46 pgsrc
55 drwxrwxr-x 2 swain swain 1024 Jan 1 18:46 schemas
56 drwxrwxr-x 2 swain swain 1024 Jan 1 18:46 templates
58 Next, I'm going to change the owner of the directory. Your web server
59 probably runs as user "nobody," so I log in as root and run the chown
62 [swain@localhost phpwiki]$ su
64 [root@localhost phpwiki]# chown nobody:nobody pages
66 Now the directory is read/writable by "nobody" and should work
67 fine. If your web server runs as a different user substitute the
71 I DON'T HAVE ROOT ACCESS...
73 If you do not have root access to your machine you are in a tougher
74 situation. What you can do is give the directory read/write permission
75 to anybody, but for security reasons this is a bad idea.
77 The second thing you can do is have your systems administrator install
78 PhpWiki for you, or at least follow the steps above to create a
79 directory owned by the web server.
81 Another solution is to let the web server create the directory for
82 you. The drawback to this approach is that you won't be able to edit
83 the files or copy them from the command line, but most people can live
84 with this limitation. (This is how you would do it on SourceForge, by
85 the way; they have a cron job that sweeps the filesystem every few
86 hours looking for things that are set world writable and change the
87 permission.) This will require you to TEMPORARILY make the phpwiki/
88 directory world writable:
94 and create a PHP file like this:
99 <title>Make a directory</title>
105 I created this to set up server-writable files
106 for the Wiki. You shouldn't have world writable files.
109 $int = mkdir("pages", 0775);
110 if ($int) { echo "mkdir returned $int (success)\n"; }
115 Put the file in the phpwiki/ directory and call it through a web
116 browser. This should create a directory owned by the web server in the
120 Now you need to restore the permissions of the phpwiki directory
126 If you have problems after all of this, try contacting the
127 phpwiki-talk list at phpwiki-talk@lists.sourceforge.net.
132 $Id: INSTALL.flatfile,v 1.2 2001-02-01 04:34:08 wainstead Exp $