]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - INSTALL.flatfile
Jeff's hacks II.
[SourceForge/phpwiki.git] / INSTALL.flatfile
1 FIXME: The flatfile backend has not yet been ported to the new database
2 scheme.  For now, it is broken.
3
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 ;-)
11
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).
15
16 First, edit lib/config.php and set the database to "file":
17
18    $WhichDatabase = 'file'; // use one of "dbm", "mysql", "pgsql", "msql",
19                            // or "file"
20
21
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
24 pages.
25
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.
29
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:
34
35 [root@localhost phpwiki]# mkdir pages
36
37 This creates a new directory:
38
39 [swain@localhost phpwiki]$ ls -l
40 total 65
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
60
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
63 command:
64
65 [swain@localhost phpwiki]$ su
66 Password: 
67 [root@localhost phpwiki]# chown nobody:nobody pages
68
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
71 appropriate name.
72
73
74 I DON'T HAVE ROOT ACCESS...
75
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.
79
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.
83
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:
92
93 cd ..
94 chmod o+wr phpwiki
95 cd phpwiki/
96
97 and create a PHP file like this:
98
99
100 <html>
101 <head>
102 <title>Make a directory</title>
103 </head>
104
105 <?
106
107    /* 
108       I created this to set up server-writable files
109       for the Wiki. You shouldn't have world writable files.
110    */
111
112    $int = mkdir("pages", 0775);
113    if ($int) { echo "mkdir returned $int (success)\n"; }
114
115 ?>
116 </html>
117
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
120 phpwiki/ directory. 
121
122 IMPORTANT
123 Now you need to restore the permissions of the phpwiki directory
124 itself:
125
126 cd ..
127 chmod 755 phpwiki
128
129 If you have problems after all of this, try contacting the
130 phpwiki-talk list at phpwiki-talk@lists.sourceforge.net.
131
132 Steve Wainstead
133 swain@panix.com
134
135 $Id: INSTALL.flatfile,v 1.5 2001-09-18 19:16:23 dairiki Exp $