Wiki source for HowtoInstalarPHP


Show raw source

=====Instalar PHP en RHEL4=====

La idea es bajar php y compilarlo realizando alguna modificación en la configuración por defecto, en este caso habilitamos FastCgi para poder usarlo con lighttpd.

Bajar src rpm de PHP:
%%
# up2date -d --src php
%%

Nota, para el primer paso, se puede usar ##--get-source## si acaso sólo se quiere el .src o se puede bajar directamente:
%%
wget ftp://updates.redhat.com/enterprise/4ES/en/os/SRPMS/php-4.3.9-3.22.9.src.rpm
%%

Instalar el src y editar spec:
%%
# rpm -ivh php-4.3.9-3.22.9.src.rpm
# up2date httpd-devel aspell-devel libjpeg-devel libpng-devel libc-client-devel mysql-devel postgresql-devel unixODBC-devel net-snmp-devel elfutils-devel libxslt-devel freetype-devel
# cd /usr/src/redhat/SPECS/
# vi php.spec
%%

Nota: si usas algun paquete rpm personalizado o más actual (en mi caso Postgresql 8.x) instala su propio -devel.

Modificar en php.spec agregando ##--enable-fastcgi##:
%%(text;485;php.spec)
%configure \
--cache-file=../config.cache \
--with-config-file-path=%{_sysconfdir} \
--with-config-file-scan-dir=%{_sysconfdir}/php.d \
--enable-force-cgi-redirect \
--enable-fastcgi \
%%

Recompilar e instalar:
%%
# rpmbuild -bb php.spec
# cd /usr/src/redhat/RPMS/i386
# rpm -Fvh php*4.3.9-3.22.9*
%%

Nota: Se puede usar -ivh o -Uvh segun convenga, y se puede especificar cada uno de los rpm que se desean instalar,

Revisar:
%%
# php -v
%%

Basado en: http://www.cyberciti.biz/tips/redhat-enterprise-linux-lighttpd-fastcgi-php.html

----
CategorySysAdmin
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki