# Preparo apache2 ya instalado para poder compilar PHP
> cd /root
> wget http://archive.debian.org/debian/pool/main/a/apache2/apache2-threaded-dev_2.2.16-6+squeeze15_i386.deb ## Busca tu paquete según la distribución que utilices y tu versión de Apache
> apt-get install libaprutil1-dev
> dpkg -i apache2-threaded-dev_2.2.16-6+squeeze15_i386.deb
> updatedb
> wget http://archive.debian.org/debian/pool/main/a/apache2/apache2-threaded-dev_2.2.16-6+squeeze15_i386.deb ## Busca tu paquete según la distribución que utilices y tu versión de Apache
> apt-get install libaprutil1-dev
> dpkg -i apache2-threaded-dev_2.2.16-6+squeeze15_i386.deb
> updatedb
> locate apxs ## Comprueba donde ha instalado el sistema las apxs, las necesitarás en el primer paso de la compilación del PHP; en mi caso será /usr/bin/apxs2, pero si el directorio es otro no pasa nada
# PHP
> mkdir /opt/source
> mkdir -p /opt/php-5.6
> apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
> ln -s /usr/lib/libc-client.a /usr/lib64/libc-client.a
> cd php-5.6.29
> ./configure \
--with-apxs2=/usr/bin/apxs2 \ # Cambia aquí la localización de apxs
--prefix=/opt/php-5.6 \
--with-pdo-pgsql \
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--with-pgsql \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql \
--with-pdo-mysql \
--with-mysqli \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-openssl \
--with-libdir=lib64 \
--enable-ftp \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-gettext \
--with-gd \
--with-jpeg-dir=/usr/lib/ \
--with-pear
> make
> make install
> mkdir -p /opt/php-5.6
> cd /opt/source # Bajo y descomprimo el código fuente en este directorio.
> apt-get install build-essential> apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
> ln -s /usr/lib/libc-client.a /usr/lib64/libc-client.a
> cd php-5.6.29
> ./configure \
--with-apxs2=/usr/bin/apxs2 \ # Cambia aquí la localización de apxs
--prefix=/opt/php-5.6 \
--with-pdo-pgsql \
--with-zlib-dir \
--with-freetype-dir \
--enable-mbstring \
--with-libxml-dir=/usr \
--enable-soap \
--enable-calendar \
--with-curl \
--with-mcrypt \
--with-zlib \
--with-gd \
--with-pgsql \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-mysql \
--with-pdo-mysql \
--with-mysqli \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--with-openssl \
--with-libdir=lib64 \
--enable-ftp \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-gettext \
--with-gd \
--with-jpeg-dir=/usr/lib/ \
--with-pear
> make
> make install
# Configuro PHP
# Por último, configurar Apache2 para que trabaje con PHP5.6
> cat /etc/apache2/mods-available/php5.load
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
No hay comentarios:
Publicar un comentario