PHP5 kompileres opp manuelt og installeres forsiktig for å ikke ødelegge for PHP4, som fremdeles må være default.
Det startes en egen Apache-instans på port 8005 som bruker PHP5-modulen istedetfor PHP4-modulen.
OBS! Dette gir _ikke_ en fullverdig installasjon av PHP5. Blant annet vil man mangle verktøy (php-config, phpize, includes, ...) for å bygge egne PHP5-moduler.
Kompilering
- tar xvzf php-5.x.y.tar.gz
- cd php-5.x.y
./configure --enable-versioning --enable-memory-limit --with-layout=GNU --with-zlib-dir=/usr --with-pdflib=/usr/local --enable-trans-sid --with-regex=php --enable-ctype --with-curl=/usr/local --enable-ftp --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr/local --with-t1lib=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-xpm-dir=/usr/X11R6 --with-iconv-dir=/usr/local --with-iconv=/usr/local --with-mysql=/usr/local --enable-overload --with-pcre-regex=yes --enable-posix --enable-session --enable-sockets --enable-sysvsem --enable-sysvshm --enable-tokenizer --with-expat-dir=/usr/local --enable-xml --with-xmlrpc --enable-xslt --with-xslt-sablot=/usr/local --with-zip=/usr/local --with-zlib=yes --with-apxs=/usr/local/sbin/apxs --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include --prefix=/usr/local --enable-cli --enable-dom --with-dom -with-libxml-dir=/usr/local/lib --with-config-file-path=/usr/local/etc/apache+php5/php5.ini
- gmake
Installering
- cp ./libs/libphp5.so /usr/local/libexec/apache/libphp5.so
- cp ./sapi/cli/php /usr/local/bin/php5
Konfigurering/kjøring
- mkdir /usr/local/etc/apache+php5
- cp /usr/local/etc/apache/* /usr/local/etc/apache+php5/
(Rediger .../apache+php5/httpd.conf)
- /usr/local/sbin/httpd -f /usr/local/etc/apache+php5/httpd.conf
/usr/local/etc/rc.d/apache+php5.sh er et rc-script for starting/stopping av Apache med PHP5.