Recuperarem el codi font de PHP:
svn checkout https://svn.php.net/repository/php/php-src/branches/PHP_5_4 php-src-5.4
Preparem llibreries i programes que necessitem per a crear el PHP 5.4 com a mòdul per a l'Apache instal·lat a l'apartat 3 d'aquesta sèrie.
apt-get install aspell curl libaspell-dev libbz2-dev libc-client-dev libcurl4-openssl-dev libfreetype6 libfreetype6-dev libjpeg62 libjpeg62-dev libmcrypt4 libmcrypt-dev libmhash2 libmhash-dev libming-dev libmysqlclient15-dev libncurses-dev libpng3 libpng12-dev libpspell-dev libreadline-dev libsasl2-dev libsnmp-dev libt1-5 libt1-dev libtidy-dev libxml2 libxml2-dev libxml2-utils libxpm4 libxpm-dev libxslt1-dev make build-essential autoconf bison
Configurem el PHP
cd php-src-5.4
./buildconf
./configure --with-apxs2=/usr/bin/apxs2 --disable-short-tags --with-openssl --with-zlib --enable-bcmath --with-bz2=/bin/bzip2 --enable-calendar --with-curl --with-curlwrappers --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-xpm-dir=/usr/lib --with-t1lib --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --enable-mbstring --with-mcrypt --with-mhash --with-ibm_db2=/opt/ibm/db2/V9.7 --with-pspell --with-readline --with-snmp --enable-soap --enable-sockets --with-tidy --enable-wddx --with-xmlrpc --with-xsl --enable-zip --with-pear --with-kerberos
I procedim a compilar, en una màquina amb 4GB de RAM i 2 processadors a 2,6GHz hem trigat 16 minuts.
make && make install
Instal·lem el php.ini preparat per a desenvolupament
cp php.ini-development /usr/local/lib/php.ini
Instal·lem el mòdul ibm_db2
pecl install ibm_db2
Indicant /opt/ibm/db2/V9.7 com a carpeta on tenim instal·lat el DB2, o allà on pertoqui.
afegim la secció ibm_db2 al php.ini
extension=/usr/local/lib/php/extensions/no-debug-zts-20100525/ibm_db2.so
ibm_db2.instance_name=db2inst1
Arrenquem l'apache
/etc/init.d/apache2 restart
I certifiquem que funciona fent
echo "" > /var/www/index.php
rm /var/www/index.html
I obrint un navegador que apunti al servidor obtindrem
Si volem tenir també opcions de MySQL:
./configure --with-apxs2=/usr/bin/apxs2 --disable-short-tags --with-openssl --with-zlib --enable-bcmath --with-bz2=/bin/bzip2 --enable-calendar --with-curl --with-curlwrappers --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-xpm-dir=/usr/lib --with-t1lib --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-imap --with-imap-ssl --with-ldap --with-ldap-sasl --enable-mbstring --with-mcrypt --with-mhash --with-ibm_db2=/opt/ibm/db2/V9.7 --with-pspell --with-readline --with-snmp --enable-soap --enable-sockets --with-tidy --enable-wddx --with-xmlrpc --with-xsl --enable-zip --with-pear --with-kerberos --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd