Source of: /manual/en/install.macosx.server.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/install.macosx.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'install.macosx.server.php',
1 => 'Compiling for OS X Server',
),
'up' =>
array (
0 => 'install.macosx.php',
1 => 'Installation on Mac OS X',
),
'prev' =>
array (
0 => 'install.macosx.bundled.php',
1 => 'Using the bundled PHP',
),
'next' =>
array (
0 => 'install.macosx.client.php',
1 => 'Installing for Apache on MacOS X Client',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="install.macosx.server" class="sect1">
<h2 class="title">Compiling for OS X Server</h2>
<p class="formalpara" id="install.macosx.server.compile" name="install.macosx.server.compile">
<h5 class="title">Mac OS X Server install</h5>
<p class="para">
</p><ol type="1">
<li class="listitem">
<span class="simpara">Get the latest distributions of Apache and PHP.</span>
</li>
<li class="listitem">
<p class="para">
Untar them, and run the <strong class="command">configure</strong> program on Apache
like so.
</p><div class="example-contents programlisting">
<div class="shellcode"><pre class="shellcode">./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</pre>
</div>
</div>
<p>
</p>
</li>
<li class="listitem">
<p class="para">
If you want the compiler to do some optimization, you may also want to
add this line:
</p><div class="example-contents programlisting">
<div class="shellcode"><pre class="shellcode">setenv OPTIM=-O2</pre>
</div>
</div>
<p>
</p>
</li>
<li class="listitem">
<p class="para">
Next, go to the PHP 4 source directory and configure it.
</p><div class="example-contents programlisting">
<div class="shellcode"><pre class="shellcode">./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-xml \
--with-apache=/src/apache_1.3.12</pre>
</div>
</div>
<p>
If you have any other additions (MySQL, GD, etc.), be sure to add them
here. For the <span class="option">--with-apache</span> string, put
in the path to your apache source directory, for example
<var class="filename">/src/apache_1.3.12</var>.
</p>
</li>
<li class="listitem">
<span class="simpara">
Type <strong class="command">make</strong> and <strong class="command">make install</strong>. This
will add a directory to your Apache source directory under
<var class="filename">src/modules/php4</var>.
</span>
</li>
<li class="listitem">
<p class="para">
Now, reconfigure Apache to build in PHP 4.
</p><div class="example-contents programlisting">
<div class="shellcode"><pre class="shellcode">./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</pre>
</div>
</div>
<p>
You may get a message telling you that <var class="filename">libmodphp4.a</var> is
out of date. If so, go to the <var class="filename">src/modules/php4</var>
directory inside your Apache source directory and run this command:
<strong class="command">ranlib libmodphp4.a</strong>. Then go back to the root of the
Apache source directory and run the above <strong class="command">configure</strong>
command again. That'll bring the link table up to date. Run
<strong class="command">make</strong> and <strong class="command">make install</strong> again.
</p>
</li>
<li class="listitem">
<span class="simpara">
Copy and rename the <var class="filename">php.ini-development</var> file to your
<var class="filename">bin</var> directory from your PHP 4
source directory:
<strong class="userinput"><code>cp php.ini-development /usr/local/bin/php.ini</code></strong>
or (if your don't have a local directory)
<strong class="userinput"><code>cp php.ini-development /usr/bin/php.ini</code></strong>
.
</span>
</li>
</ol><p>
</p>
</p>
</div><?php manual_footer(); ?>