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