Instalando PHP (v5.x.x)

Instalado sobre Mandriva 10.2 y CentOS 4.x
Bajar la última versión disponible.
Desempaquetar.
Algunos paquetes necesarios para poder compilar con las opciones que figuran más abajo en el ./configure:
libmcrypt (ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz)
libmhash (http://prdownloads.sourceforge.net/mhash/mhash-0.9.6.tar.bz2?download)
pspell (http://prdownloads.sourceforge.net/pspell/pspell-.12.2.tar.gz?download)
c-client (ftp://ftp.cac.washington.edu/imap/) (make lrh para compilar y luego ver instrucciones en: http://ar2.php.net/manual/es/ref.imap.php) (ftp://ftp.cac.washington.edu/imap/old/imap-2004g.tar.Z) (el último: 2006a me da error al compilar)
La biblioteca GD no me ha funcionado correctamente con la que viene en CentOS, así que a bajar y a compilar:
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz (compilar este primero con --enable-shared en el ./configure)
http://www.boutell.com/gd/ (haciendo referencia al anterior: ./configure --with-jpeg=/usr/local/lib)
Luego copiar los archivos gd*.h desde /usr/local/include a /usr/local/lib
yum install flex libxml2-devel openssl bzip2-devel curl-devel libpng-devel openldap-devel net-snmp-devel
cd a la carpeta donde desempaquetamos.
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-bz2 --with-cli --with-ctype --with-curl --with-gd=/usr/local/lib --with-gettext --with-iconv --with-imap=/usr/local/imap-2004g --with-imap-ssl --with-kerberos --with-ldap --with-mbstring --with-mcrypt --with-mhash --with-mysql=/usr/local/mysql --with-openssl --with-oracle --with-pcre --with-pear --with-pgsql=/usr/local/pgsql --with-pspell --with-snmp --with-ttf --with-xml --with-yp --with-zlib --enable-bcmath --enable-calendar --enable-discard-path --enable-exif --enable-force-cgi-redirect --enable-ftp --enable-gd-native-ttf --enable-magic-quotes --enable-mbregex --enable-mbstr-enc-trans --enable-mbstring=all --enable-memory-limit --enable-sockets --enable-track-vars --enable-versioning
make
make install
cp php.ini-dist /usr/local/lib/php.ini
Ahora hay que configurar un par de cosas (mínimo, hay más, obvio) en el httpd.conf del Apache:
Verificar que en la sección Dynamic Shared Object (DSO) Support figure la línea:
LoadModule php5_module modules/libphp5.so
En la sección donde dice AddType allows you to add to or override ... agregar la línea:
AddType application/x-httpd-php .php .phtml
Para que los cambios tomen efecto, reiniciar el apache con:
/usr/local/apache2/bin/apachectl restart
