| PHP
|
|---|
Una ves instaladas la ultimas versiones en base a programas fuentes de las
librerias criticas y de que tengamos instaldos los RPMs de las otras librerias
necesarios (lipjpeg-devel, zlib-devel, unixODBC-devel, etc.), procedemos a instalar
el PHP.
Descargamos el paquete.
| Once we have installed the latest version of the 'critical' lilbraries
thru source tarball and have the latest RPMs of the 'others' libraries (
libjpeg-devel, zlib-devel, unixODBC-devel, etc.), we proced to install
PHP.
Download the tarball.
|
cd $HOME_SRC
wget http://us4.php.net/get/php-4.3.6.tar.gz/from/this/mirror
|
| Extraemos los archivos y nos cambiamos al directorio recien creado.
| Extract the files and change to the new directory.
|
tar xvfz php-4.3.6.tar.gz
cd php-4.3.6
|
Los parametros de configuracion que use son:
- --with-apxs2 : Para que se cargue como modulo dinamico en el apache
- --without-mysql : No uso MySQL
- --with-gd, --with-jpeg-dir, --with-zlib-dir, --with-freetype-dir : Para que
tome la ultima version instalada y no la que viene con PHP
- --with-informix : Para conectareme a la base de datos Informix
- --with-unixODBC : Para habilitar 'otras' conexiones via ODBC
- --with-imap, --with-imap-ssl : Para poder usar clientes Webmail
Por supuesto se pueden agregar o borrar opciones segun sus necesidades.
| I use the following configuration parameters:
- --with-apxs2 : To load PHP as a dynamic module in the Apache server
- --without-mysql : I don't use MySQL
- --with-gd, --with-jpeg-dir, --with-zlib-dir, --with-freetype-dir : To force
the use of the last version of GD and not the included with PHP
- --with-informix : To connect to the Informix database
- --with-unixODBC : To enable 'others' conections thru ODBC
- --with-imap, --with-imap-ssl : To use Webmail clients
Of course you can add o remove options according to tour needs.
|
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--without-mysql --with-gd=/usr/local \
--with-jpeg-dir=/usr/local/lib \
--with-zlib-dir=/usr/local/lib \
--with-freetype-dir=/usr/local/lib \
--with-informix=$INFORMIXDIR \
--with-unixODBC=/usr/lib \
--with-imap --with-imap-ssl=/usr/local/lib
|
| Una ves que verificamos que NO mando NINGUN error el configure por librerias o
extensiones no encontradas, procedemos a compilarlo e instalarlo.
| Once verified that there're NO error messages in the configure due to
missing libraries, we proceed to compile and install.
|
make
make install
|
Despues de esto hay que modificar los archivos de configuracion de Apache para que
reconozca las extensiones .php como codigo PHP.
Se puede declarar cualquier otra extension para que se procese como PHP, incluso
se puede procesar los .html o los .asp, de esta manera el usuario
va a ver paginas con extension .asp y no adivinara que se esta procesando
con PHP.
En el archivo /usr/local/apache2/conf/httpd.conf hay que agregar estas lineas
a la altura donde estan definidos los otros AddType.
| Now we need to modify the configuration files of Apache to define the
file extension .php as PHP code.
We can define any file extension to be procesed as PHP code, even we can declare
.html or .asp as PHP code, this way when the user see pages with
extension .asp he can't guess it's a PHP page! .
In the file /usr/local/apache2/conf/httpd.conf we need to add this lines
below the others AddType.
|
AddType application/x-httpd-php .php
AddType application/x-httpd-php .wml
AddType application/x-httpd-php-source .phps
|
| Tambien hace falta el archivo de configuracion de PHP. En caso de que NO
tengas un archivo php.ini anterior, puedes copiar un archivo con la
configuracion recomendada para luego modificarlo segun tus necesidades.
| We also need a PHP configuration file. In case you DON'T have
a previous php.ini file, you can copy the recommended configuration file and
then customize it.
|
|
cp php.ini-recomended /usr/local/lib/php.ini
|
| Ahora si ya se arranca el apache con los cambios.
| We're ready to start the Apache server with the changes.
|
apachectl stop
apachectl start
|
| Para verificar la instalacion lo mejor es ejecurtar un pequeño programa PHP que
ejecute la funcion phpinfo(), ahi se verifica la lista de modulos instalados
y su configuracion.
| To verify the installation the easy way is to execute a little PHP
program with the phpinfo() function, this list the list of extension installed
and their configuration.
|
<?php
phpinfo();
?>
|