]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - doc/INSTALL.MacOSX
o Corrected a mistake in file path for Apache alias directive (the ? incorrectly...
[SourceForge/phpwiki.git] / doc / INSTALL.MacOSX
1 Using PhpWiki 1.3 with Mac OS X / Darwin
2
3 PhpWiki works quite well and retains almost complete functionality
4 when used with a default installation of Mac OS X 10.1 (or greater),
5 with only a few minor exceptions as noted below. Setting up a database
6 for the Wiki backend is probably the most difficult part of the
7 PhpWiki installation as it will require use of the Terminal utility;
8 therefore it is recommended that you at least have some familiarity
9 with the unix command prompt. However, the setup is straightforward
10 and you should be able to complete the install by following the
11 instructions in the INSTALL document included with the PhpWiki
12 download.
13
14 If you intend to compile the required database software or PHP module
15 yourself you should download and install the Developer tools from
16 Apple, which includes the necessary cc compiler, and at least
17 temporarily activate the superuser (root) account. The steps necessary
18 to do this are relatively more complicated and are beyond the scope of
19 this document.
20
21 In any case you may find Project Builder to be an attractive
22 alternative to TextEdit, especially if you are intent on heavily
23 customizing PhpWiki, working with PHP or doing any other code
24 development. Among other niceties it provides multiple undos (even
25 beyond the last file save), line numbering and syntax coloring; but
26 don't rely on PB's text colors too much, it doesn't always properly
27 handle coloring for \"escaped quotes\" which are frequently called for
28 in PHP when generating HTML code.
29
30
31 Database
32 --------
33 A suitable database for PhpWiki is not included with Mac OS X 10.1. If
34 you decide to use one of the more popular (and free) database packages
35 such as mySQL or PostgreSQL with PhpWiki, fortunately there are
36 precompiled versions of the software available. Some distributions
37 even come with Mac OS X installers which will significantly reduce the
38 amount of work you will have to do in the unix environment.
39
40 The MySQL 3.23.46 binary installation works well with Mac OS X 10.1
41 and PhpWiki. After you install and test mySQL follow the instructions
42 given in INSTALL.mysql to prepare a new database for use with PhpWiki.
43
44
45 Apache PHP Modulex
46 -----------------
47 The default PHP module for Apache as supplied by Apple does work with
48 PhpWiki but is missing support for the zlib and GD libraries. Wiki
49 will still produce a valid ZIP file when an administrator saves a ZIP
50 dump of the database but it will not use any compression.
51
52 If you want compressed ZIP dumps you will have to install a version of
53 PHP which does support the zlib library, or compile PHP yourself and
54 replace the default /usr/libexec/httpd/libphp4.so (part of the
55 Apple-supplied Apache installation).
56
57 PHP with GD library support is required to use "text2png", an
58 experimental plugin for Wiki 1.3.
59
60 PhpWiki 1.3 already knows where to find the required PEAR.php on Mac
61 OS X systems. However if you need to use PEAR with other PHP
62 applications, edit or create the file /usr/local/lib/php.ini then add
63 the following line:
64
65 include_path = ".:/System/Library/PHP";
66
67 If you compiled a version of PHP yourself (perhaps newer than the
68 4.0.6 version included by Apple) the path will already be included in
69 the php.ini file. In that case you shouldn't have to change the path,
70 unless you installed PHP into a location other than the default
71 /usr/local/ prefix.
72
73
74 Obtaining and Installing mySQL and libphp4.so
75 ---------------------------------------------
76 Mark Liyanage has graciously provided precompiled Mac OS X versions of
77 mySQL, an updated PHP module for Apache and some installation
78 instructions on his web site. He has also written some tips if you
79 want to compile these programs for yourself.
80
81     <http://www.entropy.ch/software/macosx/>
82
83 Note that whether you use the built-in PHP module or another PHP
84 module, it must be activated in Apache's httpd.conf before you can use
85 PHP. Take a look at Mark's PHP installation instructions or read the
86 Apache documentation for more information.
87
88 A good place to find other distributions of mySQL or PostgreSQL which
89 can be used with Mac OS X are listed at:
90
91     <http://versiontracker.com/macosx/>
92
93
94 PhpWiki Configuration Notes
95 ---------------------------
96 Move the phpwiki folder into the directory used by the web server. In
97 Mac OS X 10.1 this folder will be "/Library/WebServer/Documents"
98 (unless you previously changed it to somewhere else in the
99 configuration file "/private/etc/httpd/httpd.conf").
100
101 Follow the generalized installation instructions described in INSTALL
102 but with the changes below.
103
104
105 1. The Mac OS X Apache web server runs as user "www" and this works
106    fine with PhpWiki so long as "Everyone" has at least read-only
107    access in the phpwiki folder's Get Info.
108
109 If you want to perform serial dumps instead of ZIP dumps you need to
110 set at least one directory to be accessible read-write by the http
111 server. The easiest solution is probably to create a new folder called
112 "dumps" inside the phpwiki folder, then give the user "www" read-write
113 access to it in the terminal:
114
115 sudo chown www:www /System/Library/phpwiki/dumps
116 sudo chmod u+wrx /System/Library/phpwiki/dumps
117
118 2. A few lines need to be inserted into Apache's configuration in
119    order to use "nice" URLs with PhpWiki such as:
120
121     http://somehost/wiki?GoodStyle
122
123 Open the terminal and type in the following to edit the web server
124 configuration file (enter your administration password when prompted):
125
126 sudo pico /etc/httpd/httpd.conf
127
128 Scroll down to the <IfModule mod-alias.c> section. Copy the comment
129 line "#PhpWiki 1.3 aliases" and the four lines below it, then paste it
130 into the mod_alias section as shown below.
131
132 <IfModule mod_alias.c>
133
134     #
135     # Note that if you include a trailing / on fakename then the server will
136     # require it to be present in the URL.  So "/icons" isn't aliased in this
137     # example, only "/icons/".  If the fakename is slash-terminated, then the 
138     # realname must also be slash terminated, and if the fakename omits the 
139     # trailing slash, the realname must also omit it.
140     #
141     Alias /icons/ "/usr/share/httpd/icons/"
142
143 #PhpWiki 1.3 aliases
144     Alias /wiki/images/ "/Library/WebServer/Documents/phpwiki/images/"
145     Alias /wiki/images "/Library/WebServer/Documents/phpwiki/images"
146     Alias /wiki/ "/Library/WebServer/Documents/phpwiki/index.php/"
147     Alias /wiki "/Library/WebServer/Documents/phpwiki/index.php"
148
149
150 To save your changes and exit, press 'control-x', then 'y' followed by
151 the 'return' key.
152
153 Restart the Web Sharing server from the System Preferences "Sharing"
154 control panel or from the terminal:
155
156 sudo apachectl graceful
157
158 Next, edit the following lines 379, 387 and 412 of index.php to match
159 the following:
160
161 define('DATA_PATH', '/wiki');
162 define('USE_PATH_INFO', true);
163 define('VIRTUAL_PATH', '/wiki');
164
165 3. To retain your PhpWiki logs between system restarts you should
166    specify a non-temporary directory. I recommend you use the same
167    folder where the web-server stores it's logs. Change the following
168    (line 73) in index.php from:
169
170 define('ACCESS_LOG', '/tmp/wiki_access_log');
171
172 to something like:
173
174 define('ACCESS_LOG', '/private/var/log/httpd/wiki_access.log');
175
176 Note that the automatic /etc/daily and weekly cron cleanup routines
177 will not touch the Wiki log file--even if it is in the same directory
178 as the httpd logs--it will be up to you to Trash it once in a while or
179 write your own /etc/daily.local file to include it as part of a server
180 log rotation.
181
182
183 If you have problems after all of this, try contacting the
184 phpwiki-talk list at phpwiki-talk@lists.sourceforge.net.
185
186 Carsten Klapp
187 carstenklapp@mac.com