weblog / wiki

A weblog about open source development, law, technology, politics and the like.

PHP4 Installation
PHP5 Installation - Linux
Made for PHP5:
Works with PHP5:

PHP4 Apache module and PHP5 CGI in parallel on Windows

Listen 83
<Virtualhost _default_:83>
    ServerName localhost
    ServerAdmin me@localhost
    DirectoryIndex index.html index.php 
    ErrorLog logs/error.log
    <Location />
      <Limit CONNECT>
        Order allow,deny
        Allow from all
    DocumentRoot "C:/www/project-a/"
    ScriptAlias /cgi-bin/ "C:/php5/"
    Action     php5-script /cgi-bin/php-cgi.exe
    AddHandler php5-script .php .html 

PHP4 Apache module and PHP5 CGI in parallel on OS X

This section is not yet done...
#:/usr/local/php5 urs$ php5 -f go-pear.php
#:/usr/local/php5 urs$ which pear
#:/usr/local/php5 urs$ echo 'PATH=$PATH:/usr/local/php5/bin' >> ~/.bash_profile 
#:/usr/local/php5 urs$ source ~/.bash_profile 
#:/usr/local/php5 urs$ pear
Segmentation fault
Well, not yet perfect... -- UrsGehrig

Install Apache2, PHP and MySQL on OS X (10.3)

You will find here some notes and tips to compile PHP5 on OS X. Credits go to chregu at who helped me out especially with the PHP5 configure setting. -- UrsGehrig

Binaries and Libraries:
sudo apt-get install libjpeg libpng libxml2 mysql

Apache2 configure:
./configure \
--enable-module=so \
--enable-module=rewrite \
--enable-dav \

PHP5 configure:
./configure \
--disable-cgi \
--disable-pdo \
--prefix=/usr/local/php5 \
--with-zlib \
--with-iconv=/sw/ \
--without-bundle-libxml \
--with-dom=/sw/ \
--with-libxml-dir=/sw/ \
--with-xsl=/sw/ \
--disable-pear \
--with-gd \
--with-freetype-dir=/sw/lib/freetype2/ \
--with-jpeg-dir=/sw/ \
--with-png-dir=/sw/ \
--enable-sockets \
--enable-pcntl \
--enable-shmop \
--enable-sysvshm \
--enable-sysvsem \
--with-mysql=/usr/local/mysql/ \
--enable-debug \

If the above configure does not work because some libraries are missing, then apply something like the following:
rm ./config.cache before you apply another ./configure

me:/tmp/php-5.0.0b4 urs$ make
me:/tmp/php-5.0.0b4 urs$ sudo make install
Installing PHP SAPI module: apache2handler
/usr/local/apache2/build/ SH_LIBTOOL='/usr/local/apache2/build/libtool' libs/ /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libs/ /usr/local/apache2/modules/
cp libs/ /usr/local/apache2/modules/
Warning! dlname not found in /usr/local/apache2/modules/
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/
[activating module `php5' in /usr/local/apache2/conf/httpd.conf]
Installing PHP CLI binary: /usr/local/php5/bin/
Installing PHP CLI man page: /usr/local/php5/man/man1/
Installing build environment: /usr/local/php5/lib/php/build/
Installing header files: /usr/local/php5/include/php/
Installing helper programs: /usr/local/php5/bin/
program: phpize
program: php-config
program: phpextdist
me:/tmp/php-5.0.0b4 urs$

me:/usr/sbin urs$ sudo ln -s /usr/local/php5/bin/php php5

me:/usr/sbin urs$ php5 -v
PHP 5.0.0b4 (cli) (built: Mar 6 2004 15:48:06) (DEBUG)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0-dev, Copyright (c) 1998-2004 Zend Technologies


  • Acutally Freetype support using --with-freetype-dir=/sw/ did not work, even though all libraries were there. -- UrsGehrig
  • Found the solution for the freetype2 problem in; just specify --with-freetype-dir=/sw/lib/freetype2/ for a fink installation or with Apple's X11 --with-freetype-dir=/usr/X11R6 -- UrsGehrig