P U R E B S D 
OpenBSD and FreeBSD resources 
  /root | OpenBSD | FreeBSD
   >>  Main | System | Network | Daemons | Security | Software | Various

Sections  

Ports  
Packages  

CVSup  
PHP  
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
 

Contact | Feedback | License | Copyright © 2000,2001,2002,2003,2004,2005,2006 PureBSD.com
All rights reserved.
simonpam@purebsd.com