SlideShare a Scribd company logo
INSTALLING MAPSERVER AND PHP MAPSCRIPT ON LINUX


Author    : Lorensius W. L. T
Email     : lorenz@londatiga.net
Website   : http://www.londatiga.net
Link       : http://www.londatiga.net/downloads/tutorial/mapserver_install_linux.pdf


Introduction

MapServer is an open source and free software for rendering maps, images, and vector data on the web.
MapServer was originally developed by the University of Minnesota (UMN) ForNet project in
cooperation with NASA and the Minnesota Department of Natural Resources. Presently, the MapServer
project is hosted by the TerraSIP, a NASA sponsored project between the UMN and consortium of land
management interests (http://mapserver.gis.umn.edu).

MapServer can be compiled on many platforms and operating systems, but in this tutorial, I will focus on
unix like system, especially Linux.

Prerequisites

Operating system used in this tutorial is Linux Fedora Core 7 with Apache (httpd-2.0.55), PHP (php-
5.2.3), and PostgreSQL(postgresql-8.2.4) already installed using manual source installation (not using
default rpm package). Required libraries that already installed are libpng, libjpeg, libtiff, and zlib.
Installation manual for those softwares and libraries are beyond the scope of this tutorial.

Required softwares and libraries:

    1. MapServer: is the main software.
       Source: http://download.osgeo.org/mapserver/mapserver-5.0.2.tar.gz
    2. GD: used by MapServer for rendering images, version 2.0.28 or greater is required.
       Source: http://www.libgd.org/releases/gd-2.0.35.tar.gz
    3. PROJ.4: provides projection support for MapServer (also needed by PostGIS), version 4.4.6 or
       greater is required.
       Source: ftp://ftp.remotesensing.org/proj/proj-4.6.0.tar.gz
    4. GEOS: enables MapServer to do spatial operation (within, touches, union, difference,
       intersection), also needed by PostGIS, version 4.10 or greater is required.
       Source: http://geos.refractions.net/downloads/geos-3.0.0.tar.bz2
    5. GDAL: provides access to at least 42 different raster formats.
       Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz
    6. OGR: provides access to at least 18 different vector formats.
       Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz
7. CURL: is the foundation of OGC (WFS, WMS, WCS) client and server support, requires version
       7.10 or greater.
       Source: http://curl.haxx.se/download/curl-7.18.1.tar.gz
    8. PostGIS: adds support for geographic objects to the PostgreSQL.
       Source: http://www.postgis.org/download/postgis-1.3.3.tar.gz

Note:
Apache was installed under /usr/local/apache
PostgreSQL was installed under /usr/local/pgsql
All previously installed libraries (libpng, libjpeg, libtiff, and zlib) were installed under /usr/lib
Apache root directory is /data/www/html, cgi-bin directory is /data/www/cgi-bin


Installation

    1. GD

        Installation steps:

                 [lorenz@devel>>installer]$ tar –xzvf gd-2.0.35.tar.gz
                 [lorenz@devel>>installer]$ cd gd-2.0.35
                 [lorenz@devel>>gd-2.0.35]$ ./configure
                 [lorenz@devel>>gd-2.0.35]$ make
                 [lorenz@devel>>gd-2.0.35]$ make install

        Note: default installation directory is /usr/local

    2. PROJ.4

        Installation steps:

                 [lorenz@devel>>installer]$ tar –xzvf proj-4.6.0.tar.gz
                 [lorenz@devel>>installer]$ cd proj-4.6.0
                 [lorenz@devel>>proj-4.6.0]$ ./configure
                 [lorenz@devel>> proj-4.6.0]$ make
                 [lorenz@devel>> proj-4.6.0]$ make install

        Note: default installation directory is /usr/local


    3. GEOS

        Installation steps:

                 [lorenz@devel>>installer]$ tar –xjvf geos-3.0.0.tar.bz2
                 [lorenz@devel>>installer]$ cd geos-3.0.0
[lorenz@devel>>geos-3.0.0]$ ./configure
           [lorenz@devel>>geos-3.0.0]$ make
           [lorenz@devel>>geos-3.0.0]$ make install

   Note: default installation directory is /usr/local


4. GDAL

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf gdal-1.5.1.tar.gz
           [lorenz@devel>>installer]$ cd gdal-1.5.1
           [lorenz@devel>>gdal-1.5.1]$ ./configure
           [lorenz@devel>>gdal-1.5.1]$ make
           [lorenz@devel>>gdal-1.5.1]$ make install

   Note: default installation directory is /usr/local

5. CURL

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf curl-7.18.1.tar.gz
           [lorenz@devel>>installer]$ cd curl-7.18.1
           [lorenz@devel>>curl-7.18.1]$ ./configure
           [lorenz@devel>>curl-7.18.1]$ make
           [lorenz@devel>>curl-7.18.1]$ make install

   Note: default installation directory is /usr/local

6. Update ld-config

           [lorenz@devel>>installer]$ cd /etc/ld.so.conf.d/
           [lorenz@devel>>ld.so.conf.d]$ echo /usr/local/lib > usrlocalib.conf
           [lorenz@devel>>ld.so.conf.d]$ /sbin/ldconfig


7. POSTGIS

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf postgis-1.3.3.tar.gz
           [lorenz@devel>>installer]$ cd postgis-1.3.3
           [lorenz@devel>>postgis-1.3.3]$ ./configure --with-
           pgsql=/usr/local/pgsql/bin/pg_config --with-proj --with-geos
           [lorenz@devel>>postgis-1.3.3]$ make
[lorenz@devel>>postgis-1.3.3]$ make install



8. Recompile PHP as CGI

   Installation steps:

           [lorenz@devel>>installer]$ cd php-5.2.3
           [lorenz@devel> php-5.2.3 ]$ ./configure 
           > --enable-force-cgi-redirect 
           > --with-gd=/usr/local/ 
           > --with-jpeg-dir=/usr/lib 
           > --with-png-dir=/usr/lib 
           > --with-tiff-dir=/usr/lib 
           > --with-zlib-dir=/usr/lib 
           > --with-freetype-dir=/usr/lib 
           > --without-ttf 
           > --with-mysql=/usr/local/mysql/ 
           > --with-pgsql=/usr/local/pgsql/ 
           > --with-curl=/usr/local/ 
           > --with-gettext 
           > --enable-ftp 
           > --enable-xml 
           > --with-zlib 
           > --with-regex=system 
           > --enable-dbase 
           > --enable-dbx 
           > --with-config-file-path=/usr/local/lib
           [lorenz@devel>>php-5.2.3]$ make
           [lorenz@devel>>php-5.2.3]$ cp sapi/cgi/php-cgi /data/www/cgi-bin

       Note: DO NOT do a “make install”


9. MapServer

   Installation steps:

           [lorenz@devel>>installer]$ tar –xzvf mapserver-5.0.2.tar.gz
           [lorenz@devel>>installer]$ cd mapserver-5.0.2
           [lorenz@devel>>mapserver-5.0.2]$ ./configure --with-ogr=/usr/local/bin/gdal-config 
           --with-gdal=/usr/local/bin/gdal-config 
           --with-httpd=/usr/local/apache/bin/httpd 
           --with-wfsclient 
           --with-wmsclient 
           --enable-debug
--with-curl-config=/usr/local/bin/curl-config 
           --with-proj=/usr/local 
           --with-tiff 
           --with-gd=/usr/local 
           --with-jpeg 
           --with-freetype=/usr/ 
           --with-threads 
           --with-wcs 
           --with-postgis=/usr/local/pgsql/bin/pg_config 
           --with-libiconv=/usr 
           --with-geos=/usr/local/bin/geos-config 
           --with-xml2-config=/usr/bin/xml2-config 
           --with-sos 
           --with-php=../php-5.2.3/
           [lorenz@devel>>mapserver-5.0.2]$ make

   Note: DO NOT do a “make install”

   PHP MapScript installation steps;

           [lorenz@devel>>mapserver-5.0.2]$ cp mapserv legend scalebar /data/www/cgi-bin
           [lorenz@devel>>mapserver-5.0.2]$ mkdir /usr/local/lib/php/extensions
           [lorenz@devel>>mapserver-5.0.2]$ cp mapscript/php3/php_mapscript.so
           /usr/local/lib/php/extensions
           [lorenz@devel>>mapserver-5.0.2]$ cd /usr/local/lib
           Edit file php.ini and add two lines below:

           extension_dir = "/usr/local/lib/php/extensions"
           extension = "php_mapscript.so"

           Edit file /usr/local/apache/conf/httpd.conf and add two lines below:

           AddType application/x-httpd-php-cgi .phtml
           Action application/x-httpd-php-cgi /cgi-bin/php-cgi

           Restart apache (#/usr/local/apache/bin/apachectl restart)

10. Test PHP Mapscript

   To test PHP MapScript that already installed:

           Go into web root directory (/data/www/html)
           Create php file and add phpinfo() line into the file
           Save the file as info.phtml
           Open browser and point to http://localhost/info.phtml
           If installation is successful, the phpinfo page should contain part like this:
To test drawing map, you can download simple demo application from
http://www.londatiga.net/downloads/tutorial/phpmapscript-demo.tar.gz

Installation steps:

        [lorenz@devel>>installer]$ cp phpmapscript-demo.tar.gz /data/www/html
        [lorenz@devel>>installer]$ cd /data/www/html
        [lorenz@devel>>html]$ tar –xzvf phpmapscript-demo.tar.gz
        [lorenz@devel>>html]$ chmod 777 tmp
        Open browser and point to http://localhost/phpmapscript-demo
        If all things running well it should display a map

More Related Content

PPTX
2012 coscup - Build your PHP application on Heroku
PDF
Apache Hadoop Shell Rewrite
PDF
Apache Hadoop for System Administrators
DOCX
Hadoop installation
PDF
JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)
PPT
2005_Structures and functions of Makefile
PDF
Containers for sysadmins
PDF
Augeas
2012 coscup - Build your PHP application on Heroku
Apache Hadoop Shell Rewrite
Apache Hadoop for System Administrators
Hadoop installation
JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)
2005_Structures and functions of Makefile
Containers for sysadmins
Augeas

What's hot (16)

PDF
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
PDF
[ETHCon Korea 2019] Shin mansun 신만선
PDF
Paver For PyWorks 2008
PDF
Gitosis on Mac OS X Server
PDF
Conquering the Command Line
PDF
First there was the command line
PDF
Learning the command line
KEY
Clojure + MongoDB on Heroku
PDF
PDF
Хокку про Heroku
PDF
Docker for data science
PDF
Postgresql 12 streaming replication hol
PDF
Installing Cacti openSUSE Leap 42.1
PDF
Os Treat
ODP
Linux-Fu for PHP Developers
PDF
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
[ETHCon Korea 2019] Shin mansun 신만선
Paver For PyWorks 2008
Gitosis on Mac OS X Server
Conquering the Command Line
First there was the command line
Learning the command line
Clojure + MongoDB on Heroku
Хокку про Heroku
Docker for data science
Postgresql 12 streaming replication hol
Installing Cacti openSUSE Leap 42.1
Os Treat
Linux-Fu for PHP Developers
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
Ad

Viewers also liked (20)

PPTX
Cracking Pseudorandom Sequences Generators in Java Applications
PDF
Apresentação Multimídia Móveis
KEY
企业级软件的组件化和动态化开发实践
PPS
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
PDF
Montando seu DataCenter Pessoal - Fernando Massen
PDF
夏サミ2014 クラウドとCIツールで変わるエンタープライズJava開発
PPT
User Profiles: I Didn't Know I Could Do That (Updated Demo)
PDF
Owasp top 10_-_2013
PPT
What's Next with Government Big Data
PPTX
Know Your PHY Types.
PDF
Tomcat Maven Plugin
PDF
GlassFish, Maven, Cloud e Java EE
PDF
ORCID ED Report 10292013
PDF
Sistem keamanan komputer
PDF
El papel del vídeo en la Web 2.0
PDF
201501 gests423 s6_part_i
PDF
S5L2010 datasheet
PPT
Privilege Escalation
PDF
Iliad or Seaside
PDF
SoftwareAsia Product Profile
Cracking Pseudorandom Sequences Generators in Java Applications
Apresentação Multimídia Móveis
企业级软件的组件化和动态化开发实践
'A View-Based Approach to Quality of Service Modelling in Service-Oriented En...
Montando seu DataCenter Pessoal - Fernando Massen
夏サミ2014 クラウドとCIツールで変わるエンタープライズJava開発
User Profiles: I Didn't Know I Could Do That (Updated Demo)
Owasp top 10_-_2013
What's Next with Government Big Data
Know Your PHY Types.
Tomcat Maven Plugin
GlassFish, Maven, Cloud e Java EE
ORCID ED Report 10292013
Sistem keamanan komputer
El papel del vídeo en la Web 2.0
201501 gests423 s6_part_i
S5L2010 datasheet
Privilege Escalation
Iliad or Seaside
SoftwareAsia Product Profile
Ad

Similar to mapserver_install_linux (20)

PDF
Hadoop single node installation on ubuntu 14
PDF
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
PPTX
Hadoop installation on windows
KEY
Ruby and Rails Packaging to Production
PDF
PHP selber bauen
PDF
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
PPT
Hadoop Installation
PDF
Globus toolkit4installationguide
PDF
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
PDF
EF09-Installing-Alfresco-components-1-by-1.pdf
PPTX
Installing odoo v8 from github
PDF
Deploying PHP Applications with Ansible
PDF
Ansible : what's ansible & use case by REX
KEY
Write php deploy everywhere
PDF
Ef09 installing-alfresco-components-1-by-1
DOCX
Run wordcount job (hadoop)
PPTX
Hadoop 2.4 installing on ubuntu 14.04
PPT
DSpace Tutorial : Open Source Digital Library
PDF
Setting up a HADOOP 2.2 cluster on CentOS 6
Hadoop single node installation on ubuntu 14
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Hadoop installation on windows
Ruby and Rails Packaging to Production
PHP selber bauen
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
Hadoop Installation
Globus toolkit4installationguide
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
EF09-Installing-Alfresco-components-1-by-1.pdf
Installing odoo v8 from github
Deploying PHP Applications with Ansible
Ansible : what's ansible & use case by REX
Write php deploy everywhere
Ef09 installing-alfresco-components-1-by-1
Run wordcount job (hadoop)
Hadoop 2.4 installing on ubuntu 14.04
DSpace Tutorial : Open Source Digital Library
Setting up a HADOOP 2.2 cluster on CentOS 6

More from tutorialsruby (20)

PDF
<img src="../i/r_14.png" />
PDF
TopStyle Help & <b>Tutorial</b>
PDF
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
PDF
<img src="../i/r_14.png" />
PDF
<img src="../i/r_14.png" />
PDF
Standardization and Knowledge Transfer – INS0
PDF
xhtml_basics
PDF
xhtml_basics
PDF
xhtml-documentation
PDF
xhtml-documentation
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
HowTo_CSS
PDF
HowTo_CSS
PDF
BloggingWithStyle_2008
PDF
BloggingWithStyle_2008
PDF
cascadingstylesheets
PDF
cascadingstylesheets
<img src="../i/r_14.png" />
TopStyle Help & <b>Tutorial</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
<img src="../i/r_14.png" />
<img src="../i/r_14.png" />
Standardization and Knowledge Transfer – INS0
xhtml_basics
xhtml_basics
xhtml-documentation
xhtml-documentation
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
HowTo_CSS
HowTo_CSS
BloggingWithStyle_2008
BloggingWithStyle_2008
cascadingstylesheets
cascadingstylesheets

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
sap open course for s4hana steps from ECC to s4
Chapter 3 Spatial Domain Image Processing.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I

mapserver_install_linux

  • 1. INSTALLING MAPSERVER AND PHP MAPSCRIPT ON LINUX Author : Lorensius W. L. T Email : lorenz@londatiga.net Website : http://www.londatiga.net Link : http://www.londatiga.net/downloads/tutorial/mapserver_install_linux.pdf Introduction MapServer is an open source and free software for rendering maps, images, and vector data on the web. MapServer was originally developed by the University of Minnesota (UMN) ForNet project in cooperation with NASA and the Minnesota Department of Natural Resources. Presently, the MapServer project is hosted by the TerraSIP, a NASA sponsored project between the UMN and consortium of land management interests (http://mapserver.gis.umn.edu). MapServer can be compiled on many platforms and operating systems, but in this tutorial, I will focus on unix like system, especially Linux. Prerequisites Operating system used in this tutorial is Linux Fedora Core 7 with Apache (httpd-2.0.55), PHP (php- 5.2.3), and PostgreSQL(postgresql-8.2.4) already installed using manual source installation (not using default rpm package). Required libraries that already installed are libpng, libjpeg, libtiff, and zlib. Installation manual for those softwares and libraries are beyond the scope of this tutorial. Required softwares and libraries: 1. MapServer: is the main software. Source: http://download.osgeo.org/mapserver/mapserver-5.0.2.tar.gz 2. GD: used by MapServer for rendering images, version 2.0.28 or greater is required. Source: http://www.libgd.org/releases/gd-2.0.35.tar.gz 3. PROJ.4: provides projection support for MapServer (also needed by PostGIS), version 4.4.6 or greater is required. Source: ftp://ftp.remotesensing.org/proj/proj-4.6.0.tar.gz 4. GEOS: enables MapServer to do spatial operation (within, touches, union, difference, intersection), also needed by PostGIS, version 4.10 or greater is required. Source: http://geos.refractions.net/downloads/geos-3.0.0.tar.bz2 5. GDAL: provides access to at least 42 different raster formats. Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz 6. OGR: provides access to at least 18 different vector formats. Source: http://download.osgeo.org/gdal/gdal-1.5.1.tar.gz
  • 2. 7. CURL: is the foundation of OGC (WFS, WMS, WCS) client and server support, requires version 7.10 or greater. Source: http://curl.haxx.se/download/curl-7.18.1.tar.gz 8. PostGIS: adds support for geographic objects to the PostgreSQL. Source: http://www.postgis.org/download/postgis-1.3.3.tar.gz Note: Apache was installed under /usr/local/apache PostgreSQL was installed under /usr/local/pgsql All previously installed libraries (libpng, libjpeg, libtiff, and zlib) were installed under /usr/lib Apache root directory is /data/www/html, cgi-bin directory is /data/www/cgi-bin Installation 1. GD Installation steps: [lorenz@devel>>installer]$ tar –xzvf gd-2.0.35.tar.gz [lorenz@devel>>installer]$ cd gd-2.0.35 [lorenz@devel>>gd-2.0.35]$ ./configure [lorenz@devel>>gd-2.0.35]$ make [lorenz@devel>>gd-2.0.35]$ make install Note: default installation directory is /usr/local 2. PROJ.4 Installation steps: [lorenz@devel>>installer]$ tar –xzvf proj-4.6.0.tar.gz [lorenz@devel>>installer]$ cd proj-4.6.0 [lorenz@devel>>proj-4.6.0]$ ./configure [lorenz@devel>> proj-4.6.0]$ make [lorenz@devel>> proj-4.6.0]$ make install Note: default installation directory is /usr/local 3. GEOS Installation steps: [lorenz@devel>>installer]$ tar –xjvf geos-3.0.0.tar.bz2 [lorenz@devel>>installer]$ cd geos-3.0.0
  • 3. [lorenz@devel>>geos-3.0.0]$ ./configure [lorenz@devel>>geos-3.0.0]$ make [lorenz@devel>>geos-3.0.0]$ make install Note: default installation directory is /usr/local 4. GDAL Installation steps: [lorenz@devel>>installer]$ tar –xzvf gdal-1.5.1.tar.gz [lorenz@devel>>installer]$ cd gdal-1.5.1 [lorenz@devel>>gdal-1.5.1]$ ./configure [lorenz@devel>>gdal-1.5.1]$ make [lorenz@devel>>gdal-1.5.1]$ make install Note: default installation directory is /usr/local 5. CURL Installation steps: [lorenz@devel>>installer]$ tar –xzvf curl-7.18.1.tar.gz [lorenz@devel>>installer]$ cd curl-7.18.1 [lorenz@devel>>curl-7.18.1]$ ./configure [lorenz@devel>>curl-7.18.1]$ make [lorenz@devel>>curl-7.18.1]$ make install Note: default installation directory is /usr/local 6. Update ld-config [lorenz@devel>>installer]$ cd /etc/ld.so.conf.d/ [lorenz@devel>>ld.so.conf.d]$ echo /usr/local/lib > usrlocalib.conf [lorenz@devel>>ld.so.conf.d]$ /sbin/ldconfig 7. POSTGIS Installation steps: [lorenz@devel>>installer]$ tar –xzvf postgis-1.3.3.tar.gz [lorenz@devel>>installer]$ cd postgis-1.3.3 [lorenz@devel>>postgis-1.3.3]$ ./configure --with- pgsql=/usr/local/pgsql/bin/pg_config --with-proj --with-geos [lorenz@devel>>postgis-1.3.3]$ make
  • 4. [lorenz@devel>>postgis-1.3.3]$ make install 8. Recompile PHP as CGI Installation steps: [lorenz@devel>>installer]$ cd php-5.2.3 [lorenz@devel> php-5.2.3 ]$ ./configure > --enable-force-cgi-redirect > --with-gd=/usr/local/ > --with-jpeg-dir=/usr/lib > --with-png-dir=/usr/lib > --with-tiff-dir=/usr/lib > --with-zlib-dir=/usr/lib > --with-freetype-dir=/usr/lib > --without-ttf > --with-mysql=/usr/local/mysql/ > --with-pgsql=/usr/local/pgsql/ > --with-curl=/usr/local/ > --with-gettext > --enable-ftp > --enable-xml > --with-zlib > --with-regex=system > --enable-dbase > --enable-dbx > --with-config-file-path=/usr/local/lib [lorenz@devel>>php-5.2.3]$ make [lorenz@devel>>php-5.2.3]$ cp sapi/cgi/php-cgi /data/www/cgi-bin Note: DO NOT do a “make install” 9. MapServer Installation steps: [lorenz@devel>>installer]$ tar –xzvf mapserver-5.0.2.tar.gz [lorenz@devel>>installer]$ cd mapserver-5.0.2 [lorenz@devel>>mapserver-5.0.2]$ ./configure --with-ogr=/usr/local/bin/gdal-config --with-gdal=/usr/local/bin/gdal-config --with-httpd=/usr/local/apache/bin/httpd --with-wfsclient --with-wmsclient --enable-debug
  • 5. --with-curl-config=/usr/local/bin/curl-config --with-proj=/usr/local --with-tiff --with-gd=/usr/local --with-jpeg --with-freetype=/usr/ --with-threads --with-wcs --with-postgis=/usr/local/pgsql/bin/pg_config --with-libiconv=/usr --with-geos=/usr/local/bin/geos-config --with-xml2-config=/usr/bin/xml2-config --with-sos --with-php=../php-5.2.3/ [lorenz@devel>>mapserver-5.0.2]$ make Note: DO NOT do a “make install” PHP MapScript installation steps; [lorenz@devel>>mapserver-5.0.2]$ cp mapserv legend scalebar /data/www/cgi-bin [lorenz@devel>>mapserver-5.0.2]$ mkdir /usr/local/lib/php/extensions [lorenz@devel>>mapserver-5.0.2]$ cp mapscript/php3/php_mapscript.so /usr/local/lib/php/extensions [lorenz@devel>>mapserver-5.0.2]$ cd /usr/local/lib Edit file php.ini and add two lines below: extension_dir = "/usr/local/lib/php/extensions" extension = "php_mapscript.so" Edit file /usr/local/apache/conf/httpd.conf and add two lines below: AddType application/x-httpd-php-cgi .phtml Action application/x-httpd-php-cgi /cgi-bin/php-cgi Restart apache (#/usr/local/apache/bin/apachectl restart) 10. Test PHP Mapscript To test PHP MapScript that already installed: Go into web root directory (/data/www/html) Create php file and add phpinfo() line into the file Save the file as info.phtml Open browser and point to http://localhost/info.phtml If installation is successful, the phpinfo page should contain part like this:
  • 6. To test drawing map, you can download simple demo application from http://www.londatiga.net/downloads/tutorial/phpmapscript-demo.tar.gz Installation steps: [lorenz@devel>>installer]$ cp phpmapscript-demo.tar.gz /data/www/html [lorenz@devel>>installer]$ cd /data/www/html [lorenz@devel>>html]$ tar –xzvf phpmapscript-demo.tar.gz [lorenz@devel>>html]$ chmod 777 tmp Open browser and point to http://localhost/phpmapscript-demo If all things running well it should display a map