]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - INSTALL.flatfile
Installation directions for flat file Wikis.
[SourceForge/phpwiki.git] / INSTALL.flatfile
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 might work for you.
5
6 Installation is similar to using a DBM file for storing the pages.
7 You should read the main INSTALL file before this one (it's not long
8 and complicated so go ahead and we'll wait for you right here).
9
10 First, edit lib/config.php and set the database to "file":
11
12    $WhichDatabase = 'file'; // use one of "dbm", "mysql", "pgsql", "msql",
13                            // or "file"
14
15
16 Now, the key thing is you need a directory that the web server can 
17 read and write to. This is where it will store current and archived
18 pages.
19
20 If you have root access the next section applies to you. If you don't
21 have root access, skip down to the section "I DON'T HAVE ROOT ACCESS"
22 to see what options you have.
23
24 Choose where you want to have the pages stored; on my system I put
25 them in a directory under the PhpWiki root directory. That is, I
26 installed my PhpWiki in /home/swain/public_html/flatfiletest/phpwiki.
27 I created a directory called "pages" like this:
28
29 [root@localhost phpwiki]# mkdir pages
30
31 This creates a new directory:
32
33 [swain@localhost phpwiki]$ ls -l
34 total 65
35 -rw-r--r--    1 swain    swain        1776 Dec 22 16:10 CREDITS
36 -rw-r--r--    1 swain    swain        6323 Dec 12 16:53 DBLIB.txt
37 -rw-r--r--    1 swain    swain       10373 Nov  5 22:19 HISTORY
38 -rw-r--r--    1 swain    swain        3241 Oct  8 15:08 INSTALL
39 -rw-r--r--    1 swain    swain        1241 Oct  8 14:12 INSTALL.mSQL
40 -rw-r--r--    1 swain    swain        1584 Oct  8 14:12 INSTALL.mysql
41 -rw-r--r--    1 swain    swain        2001 Oct  8 15:19 INSTALL.pgsql
42 -rw-r--r--    1 swain    swain       18106 Jun  2  2000 LICENSE
43 -rw-r--r--    1 swain    swain        2873 Dec 12 16:24 README
44 drwxrwxr-x    2 swain    swain        1024 Jan  1 18:46 admin
45 -rw-r--r--    1 swain    swain        2366 Nov 13 05:59 admin.php
46 drwxrwxr-x    2 swain    swain        1024 Jan  1 18:46 images
47 -rw-r--r--    1 swain    swain        1305 Nov  8 10:34 index.php
48 drwxrwxr-x    2 swain    swain        1024 Jan  3 22:44 lib
49 drwxrwxr-x    6 swain    swain        1024 Jan  1 18:46 locale
50 drwxrwxr-x    4 swain    swain        1024 Jan  1 18:50 pages
51 drwxrwxr-x    2 swain    swain        1024 Jan  1 18:46 pgsrc
52 drwxrwxr-x    2 swain    swain        1024 Jan  1 18:46 schemas
53 drwxrwxr-x    2 swain    swain        1024 Jan  1 18:46 templates
54
55 Next, I'm going to change the owner of the directory. Your web server
56 probably runs as user "nobody," so I log in as root and run the chown
57 command:
58
59 [swain@localhost phpwiki]$ su
60 Password: 
61 [root@localhost phpwiki]# chown nobody:nobody pages
62
63 Now the directory is read/writable by "nobody" and should work
64 fine. If your web server runs as a different user substitute the
65 appropriate name.
66
67
68 I DON'T HAVE ROOT ACCESS...
69
70 If you do not have root access to your machine you are in a tougher
71 situation. What you can do is give the directory read/write permission
72 to anybody, but for security reasons this is a bad idea.
73
74 The second thing you can do is have your systems administrator install
75 PhpWiki for you, or at least follow the steps above to create a
76 directory owned by the web server.
77
78 Another solution is to let the web server create the directory for
79 you. The drawback to this approach is that you won't be able to edit
80 the files or copy them from the command line, but most people can live
81 with this limitation. This will require you to TEMPORARILY make the
82 phpwiki/ directory world writable:
83
84 cd ..
85 chmod o+wr phpwiki
86 cd phpwiki/
87
88 and create a PHP file like this:
89
90
91 <html>
92 <head>
93 <title>Make a directory</title>
94 </head>
95
96 <?
97
98    /* 
99       I created this to set up server-writable files
100       for the Wiki. You shouldn't have world writable files.
101    */
102
103    $int = mkdir("pages", 0775);
104    if ($int) { echo "mkdir returned $int (success)\n"; }
105
106 ?>
107 </html>
108
109 Put the file in the phpwiki/ directory and call it through a web
110 browser. This should create a directory owned by the web server in the
111 phpwiki/ directory. 
112
113 IMPORTANT
114 Now you need to restore the permissions of the phpwiki directory
115 itself:
116
117 cd ..
118 chmod 755 phpwiki
119
120 If you have problems after all of this, try contacting the
121 phpwiki-talk list at phpwiki-talk@lists.sourceforge.net.
122
123 Steve Wainstead
124 swain@wcsb.org
125
126 $Id: INSTALL.flatfile,v 1.1 2001-01-06 19:30:31 wainstead Exp $