Instalar php 5.3 y mapserver en Centos 7

Bueno, me pasó que hay algunas aplicaciones viejas que necesitan aún soporte para php 5.3, es por eso que lo tuve que compilar de cero ya que no hay soporte en Centos, acá les dejo una guía por si le sirve a alguien más.

Primero instalamos todos los binarios que podemos para ahorrarnos algo de trabajo

yum install gd-devel libcurl-devel libtiff-devel libjpeg-turbo-devel libpng-devel php5-devel libcairo-devel libreadline-devel gcc gcc-c++ libxml2-devel postgresql-devel postgresql-server postgresql-contrib libtool bison flex-devel flex openssl-devel byacc bison-devel armadillo-devel poppler-devel freexl-devel libwebp-devel sqlite-devel xerces-c-devel jasper-devel netcdf-devel libgeotiff-devel cfitsio-devel giflib-devel ogdi-devel libgta-devel 

Compilamos proj4…

cd /usr/src
wget http://download.osgeo.org/proj/proj-4.9.2.tar.gz
tar -xzf proj-4.9.2.tar.gz 
cd proj-4.9.2
./configure --prefix=/usr/
make
make install
cd ..

Ahora libgeos

wget "http://download.osgeo.org/geos/geos-3.3.9.tar.bz2"
tar -xjf geos-3.3.9.tar.bz2 
cd geos-3.3.9
./configure --prefix=/usr/
make
make install
cd ..

Ahora el postgis

wget "http://download.osgeo.org/postgis/source/postgis-1.5.8.tar.gz"
tar -xzf postgis-1.5.8.tar.gz
cd postgis-1.5.8
./configure 
make
make install
cd ..

El ming enemigo de Flash, genial este nombre

wget "http://sourceforge.net/projects/ming/files/Releases/ming-0.4.4.tar.bz2/download"
mv download ming.tar.bz
tar -xjf ming.tar.bz 
cd ming-0.4.4/
./configure
make && make install
cd ..

El php, ya falta poco

wget "http://php.net/get/php-5.3.27.tar.gz/from/this/mirror"
mv mirror php.tar.gz
tar -xzf php.tar.gz 
cd php-5.3.27/
./configure  --enable-cli --with-pgsql --with-curl --with-openssl --enable-pdo  --with-gettext --enable-mbstring --with-apxs2 --with-gd --with-zlib --with-config-file-scan-dir=/etc/php.d/ --with-jpeg-dir=/lib64/
make
make install

Una librería que es necesaria en centos es hdf4

wget "http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.11.tar"
tar -xf hdf-4.2.11.tar
cd hdf-4.2.11
./configure --enable-shared --prefix=/usr/local/ --disable-fortran
make && make install

El goal que el que trae Centos no nos servirá

wget "http://download.osgeo.org/gdal/1.11.3/gdal-1.11.3.tar.gz"
tar -xzf gdal-1.11.3.tar.gz
cd gdal-1.11.3
./configure --prefix=/usr/local/ --with-png --with-jpeg --with-geotiff --with-libtiff --with-geos --with-pg --with-libz --without-jasper --with-expat
make
make install
cd ..

Al fin el maperver

wget "http://download.osgeo.org/mapserver/mapserver-5.4.2.tar.gz"
tar -xzf mapserver-5.4.2.tar.gz
cd mapserver-5.4.2
./configure --with-gd --with-png --with-zlib --with-jpeg --with-libiconv --with-pdf --with-proj --with-threads --with-gdal --with-postgis --with-httpd=/usr/sbin/httpd --with-php=/usr/local/include/php/ --with-cairo --with-ming --with-curl --with-wms --with-wmsclient --with-sos --with-ogr --with-jpeg --with-geos --with-freetype
make
cp mapserv /var/www/cgi-bin/
cp mapscript/php3/php_mapscript.so /usr/lib64/php/modules/

Editamos el archivo /etc/php.d/mapscript.ini que quede así:
——
; Enable zip extension module
extension=php_mapscript.so
–EOF–

Y con eso estaría.

Comments are closed.