File: install.macosx.xml

package info (click to toggle)
phpdoc 20020310-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 35,272 kB
  • ctags: 354
  • sloc: xml: 799,767; php: 1,395; cpp: 500; makefile: 200; sh: 140; awk: 51
file content (190 lines) | stat: -rw-r--r-- 6,209 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<sect1 id="install.macosx">
 <title>Unix/Mac OS X installs</title>
 <para>
  This section contains notes and hints specific to installing
  PHP on Mac OS X Server.
 </para>
 <sect2 id="install.macosx.packages">
  <title>Using Packages</title>
  <simpara>
   There are a few pre-packaged and pre-compiled versions of PHP for
   Mac OS X. This can help in setting up a standard
   configuration, but if you need to have a different set of features
   (such as a secure server, or a different database driver), you may
   need to build PHP and/or your web server yourself. If you are unfamiliar
   with building and compiling your own software, it's worth
   checking whether somebody has already built a packaged
   version of PHP with the features you need.
  </simpara>
 </sect2>
 <sect2 id="install.macosx.compile">
  <title>Compiling for OS X server</title>
  <simpara>
   There are two slightly different versions of Mac OS X, client and
   server. The following is for OS X Server.
  </simpara>
   <example id="install.macosx.compile.example">
   <title>Mac OS X server install</title>
   <screen>
<![CDATA[
1. Get the latest distributions of Apache and PHP
2. Untar them, and run the configure program on Apache like so.
    ./configure --exec-prefix=/usr \ 
    --localstatedir=/var \ 
    --mandir=/usr/share/man \ 
    --libexecdir=/System/Library/Apache/Modules \ 
    --iconsdir=/System/Library/Apache/Icons \ 
    --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \ 
    --enable-shared=max \ 
    --enable-module=most \ 
    --target=apache 

4. You may also want to add this line: 
    setenv OPTIM=-O2 
    If you want the compiler to do some optimization. 
    
5. Next, go to the PHP 4 source directory and configure it. 
    ./configure --prefix=/usr \ 
    --sysconfdir=/etc \ 
    --localstatedir=/var \ 
    --mandir=/usr/share/man \ 
    --with-xml \ 
    --with-apache=/src/apache_1.3.12 

    If you have any other addiitons (MySQL, GD, etc.), be sure to add
    them here. For the --with-apache string, put in the path to your 
    apache source directory, for example "/src/apache_1.3.12". 
6. make
7. make install    
    This will add a directory to your Apache source directory under
    src/modules/php4.
    
8. Now, reconfigure Apache to build in PHP 4.
    ./configure --exec-prefix=/usr \ 
    --localstatedir=/var \ 
    --mandir=/usr/share/man \ 
    --libexecdir=/System/Library/Apache/Modules \ 
    --iconsdir=/System/Library/Apache/Icons \ 
    --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \ 
    --enable-shared=max \ 
    --enable-module=most \ 
    --target=apache \ 
    --activate-module=src/modules/php4/libphp4.a 

    You may get a message telling you that libmodphp4.a is out of date.
    If so, go to the src/modules/php4 directory inside your apache
    source directory and run this command: 

    ranlib libmodphp4.a 

    Then go back to the root of the apache source directory and run the
    above configure command again. That'll bring the link table up to
    date. 

9. make

10. make install

11. copy and rename the php.ini-dist file to your "bin" directory from your
    PHP 4 source directory:
    cp php.ini-dist /usr/local/bin/php.ini 

    or (if your don't have a local directory) 

    cp php.ini-dist /usr/bin/php.ini 
]]>
   </screen>
  </example>
  <simpara>
   Other examples for
   <ulink url="&url.stepwise.macosx-client;">Mac OS X client</ulink>
   and
   <ulink url="&url.stepwise.macosx-client;">Mac OS X server</ulink>
   are available at <ulink url="&url.stepwise;">Stepwise</ulink>.
  </simpara>
 </sect2>
 <sect2 id="install.macosx.client">
  <title>Compiling for MacOS X client</title>
  <simpara>
   Those tips are graciously provided by <ulink url="&url.macosx;">Marc Liyanage</ulink>.
  </simpara>
  <simpara>
   The PHP module for the Apache web server included in Mac OS X.
   This version includes support for the MySQL and PostgreSQL databases.
  </simpara>
  <simpara>
   NOTE: Be careful when you do this, you could screw up your Apache web server!
  </simpara>
  <para>
   Do this to install:
   <itemizedlist>
    <listitem>
     <simpara>
      1.	Open a terminal window 
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      2.	Type "wget http://www.diax.ch/users/liyanage/software/macosx/libphp4.so.gz",
      wait for download to finish 
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      3.	Type "gunzip libphp4.so.gz" 
     </simpara>
    </listitem>
    <listitem>
     <simpara>
      4.	Type "sudo apxs -i -a -n php4 libphp4.so" 
     </simpara>
    </listitem>
   </itemizedlist>
   Now type "<literal>sudo open -a TextEdit /etc/httpd/httpd.conf</literal>"
   TextEdit will open with the web server configuration file. Locate these 
   two lines towards the end of the file: (Use the Find command)
   <programlisting role="apache">
<![CDATA[
   #AddType application/x-httpd-php .php 
   #AddType application/x-httpd-php-source .phps
]]>
   </programlisting>
   Remove the two hash marks (<literal>#</literal>), then save the file and quit TextEdit.
  </para>
  <para>
   Finally, type "<literal>sudo apachectl graceful</literal>" to restart the web server.
  </para>
  <para>
   PHP should now be up and running. You can test it by dropping a file into 
   your "Sites" folder which is called "test.php". Into that file, write this
   line: "<literal>&lt;?php phpinfo() ?&gt;</literal>".
  </para>
  <para>
   Now open up <literal>127.0.0.1/~your_username/test.php</literal> in your web browser.
   You should see a status table with information about the PHP module.
  </para>
 </sect2>
</sect1>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->