Using Ports
You can also compile up PHP from source using
the ports tree. 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 no_* FLAVOR. For example, to skip building the imap module, set the FLAVOR to no_imap.
Common Problems
-
The default install of Apache runs inside a chroot(2)
jail, which will restrict PHP scripts to accessing
files under /var/www. You will therefore need to create a /var/www/tmp 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 localhost interface. If you use network functions, some files from /etc such as /etc/resolv.conf and /etc/services will need to be moved into /var/www/etc. 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 OpenBSD
FAQ.
-
The OpenBSD 3.4 package for the gd extension
requires XFree86 to be installed. If you do not wish
to use some of the font features that require X11,
install the php4-gd-4.3.3-no_x11.tgz package instead.
Older Releases
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).
|