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