php-doc-en/install/unix/openbsd.xml

121 lines
4.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<sect1 id="install.unix.openbsd">
<title>OpenBSD installation notes</title>
<para>
This section contains notes and hints specific to installing
PHP on <ulink url="&url.openbsd;">OpenBSD 3.4</ulink>.
</para>
<sect2 id="install.unix.openbsd.packages">
<title>Using Binary Packages</title>
<simpara>
Using binary packages to install PHP on OpenBSD is the recommended
and simplest method. The core package has been separated from the various
modules, and each can be installed and removed independently from the others.
The files you need can be found on your OpenBSD CD or on the FTP site.
</simpara>
<simpara>
The main package you need to install is <filename>php4-core-4.3.3.tgz</filename>,
which contains the basic engine (plus gettext and iconv). Next, take a look
at the module packages, such as <filename>php4-mysql-4.3.3.tgz</filename>
or <filename>php4-imap-4.3.3.tgz</filename>. You need to use the <command>phpxs</command>
command to activate and deactivate these modules in your &php.ini;.
</simpara>
<example id="install.unix.openbsd.ports.example">
<title>OpenBSD Package Install Example</title>
<programlisting role="shell">
<![CDATA[
# pkg_add php4-core-4.3.3.tgz
# /usr/local/sbin/phpxs -s
# cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini
(add in mysql)
# pkg_add php4-mysql-4.3.3.tgz
# /usr/local/sbin/phpxs -a mysql
(add in imap)
# pkg_add php4-imap-4.3.3.tgz
# /usr/local/sbin/phpxs -a imap
(remove mysql as a test)
# pkg_delete php4-mysql-4.3.3
# /usr/local/sbin/phpxs -r mysql
(install the PEAR libraries)
# pkg_add php4-pear-4.3.3.tgz
]]>
</programlisting>
</example>
<simpara>
Read the <ulink url="&url.openbsd.packages;">packages(7)</ulink>
manual page for more information about binary packages on OpenBSD.
</simpara>
</sect2>
<sect2 id="install.unix.openbsd.ports">
<title>Using Ports</title>
<simpara>
You can also compile up PHP from source using the <ulink url="&url.openbsd.ports;">ports tree</ulink>.
However, this is only recommended for users familiar with OpenBSD. The PHP 4 port
is split into two sub-directories: core and extensions. The
extensions directory generates sub-packages for all of the supported
PHP modules. If you find you do not want to create some of these modules,
use the <command>no_*</command> FLAVOR. For example, to skip building
the imap module, set the FLAVOR to <command>no_imap</command>.
</simpara>
</sect2>
<sect2 id="install.unix.openbsd.faq">
<title>Common Problems</title>
<itemizedlist>
<listitem>
<simpara>The default install of Apache runs inside a
<ulink url="&url.openbsd.chroot;">chroot(2) jail</ulink>, which will restrict PHP scripts to
accessing files under <filename>/var/www</filename>. You will therefore need to create a
<filename>/var/www/tmp</filename> directory for PHP session files to be stored, or use an
alternative session backend. In addition, database sockets need to be placed inside the
jail or listen on the <filename>localhost</filename> interface. If you use network functions,
some files from <filename>/etc</filename> such as <filename>/etc/resolv.conf</filename> and
<filename>/etc/services</filename> will need to be moved into <filename>/var/www/etc</filename>.
The OpenBSD PEAR package automatically installs into the correct chroot directories, so
no special modification is needed there. More information on the OpenBSD Apache is available
in the <ulink url="&url.openbsd.apachefaq;">OpenBSD FAQ</ulink>.
</simpara>
</listitem>
<listitem>
<simpara>
The OpenBSD 3.4 package for the <ulink url="&url.gd;">gd</ulink> extension requires
XFree86 to be installed. If you do not wish to use some of the font features that
require X11, install the <filename>php4-gd-4.3.3-no_x11.tgz</filename> package instead.
</simpara>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="install.unix.openbsd.older">
<title>Older Releases</title>
<simpara>
Older releases of OpenBSD used the FLAVORS system to compile up
a statically linked PHP. Since it is hard to generate binary packages using
this method, it is now deprecated. You can still use the old stable
ports trees if you wish, but they are unsupported by the OpenBSD team.
If you have any comments about this, the current maintainer for the port
is Anil Madhavapeddy (avsm at openbsd dot org).
</simpara>
</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
-->