PHP and OpenBSD

PHP (4.0.6) installation process I followed:

  1. Download the PHP source package:

    wget 'http://www.php.net:8000/distributions/php-4.0.6.tar.gz'

  2. Extract the sources:

    tar xvfz php-4.0.6.tar.gz

    And cd to the php-4.0.6 directory.

  3. Configure PHP:

    ./configure --with-apxs --with-mysql=/usr/local \
    --with-config-file-path=/var/www/conf --disable-xml \
    --disable-pear --enable-bcmath --enable-magic-quotes

    Leave out the --with-mysql=/usr/local option if you don’t want MySQL support or MySQL is not installed.

  4. Compile PHP:

    make > /dev/null

  5. Stop Apache:

    /usr/sbin/apachectl stop

  6. Install the PHP module:

    make install

    or copy the libphp4.so.0.0 in the .libs/ directly to/usr/lib/apache/modules/libphp4.so if you like that better (-:

  7. Edit /var/www/conf/httpd.conf:

    Make sure that the following line is present and commented out:

    LoadModule php4_module /usr/lib/apache/modules/libphp4.so

    Search for «#AddType application/x-httpd-php .php» and remove the # in front of it, thereby telling Apache the line isn’t a comment anymore.

    I added also the .php3 extenstion to it, so files ending in .php3 are also processed by the PHP engine. The end result:

    AddType application/x-httpd-php .php .php3

  8. Start Apache:

    /usr/sbin/apachectl start

Comments are closed.