[Mapserver-users] Solved--> --with-php, Mapserver 4.0.1, and Fedora

Lindsay C. Blanton lindsay at lcblanton.com
Thu Apr 8 05:46:30 PDT 2004


Ok, I think I've resolved this issue.  Many thanks to Paul and Daniel
for their insight on this problem.

To get php_mapscript working properly on a Redhat Fedora box, I used the
following steps:

1.  Download the php-devel rpm from Redhat and install
2.  Compile mapserver with the --with-php=/usr/include/php option
3.  Copy mapserv to /cgi-bin
4.  Copy the php_mapscript.so file into /usr/lib/php4/
5.  Create a php wrapper script (php.sh) for the php cgi and save it
into /cgi/bin:

    #!/bin/bash
    export SCRIPT_FILENAME=$PATH_TRANSLATED
    /usr/bin/php

6.  Add the following action handlers for phtml files in httpd.conf

    Action phtml-script /cgi-bin/php.sh
    AddHandler phtml-script .phtml 

Now apache calls the php cgi for mapscript php files, and the php apache
module is called for everything else.

Hope this helps someone out there using preinstalled Linux
distributions.

Lindsay

----------------------------------------
Lindsay C. Blanton
Webmaster
http://www.radioreference.com


> -----Original Message-----
> From: Daniel Morissette [mailto:dmorissette at dmsolutions.ca] 
> Sent: Wednesday, April 07, 2004 8:19 PM
> To: Paul Dugas
> Cc: Lindsay C. Blanton; mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] --with-php, Mapserver 4.0.1, and Fedora
> 
> 
> Paul Dugas wrote:
> > 
> > Tried it today with the same setup and got a bit farther 
> but not all 
> > the way.  I installed the php-devel RPM rather than the full source 
> > package and got it to configure using 'configure 
> > --with-php=/usr/include/php/main'.  Then I manually modified the 
> > resulting Makefile in mapscript/php3/ changing
> > 
> >   PHP_SRC_DIR = /usr/include/php/main
> > 
> > to
> > 
> >   PHP_SRC_DIR = /usr/include/php/
> > 
> 
> Interesting coincidence, I was actually working on this exact problem 
> yesterday and (hopefully) fixed it in the development version 
> (4.1 CVS).
> 
> What I found in my tests is that with previous versions of MapServer 
> (4.0 and older), it should be possible to build against an 
> "installed" 
> PHP (or the php-devel RPM) if you point configure to the 
> /usr/include/php directory (do not include main), e.g.
> 
>    ./configure .... --with-php=/usr/include/php
> 
> with that you shouldn't have to manually edit the makefile.
> 
> With the 4.1 (CVS) version, just using --with-php=/usr should do.
> 
> 
> > The build went okay but I got all kinds of errors (didn't 
> record them 
> > but could if needed) when I copied the SO into the right directory, 
> > fired up apache, and hit some of the examples.  I'm 
> wondering if this 
> > might be an apache 2.0 problem?
> > 
> 
> Note that PHP MapScript requires PHP configured as a CGI, so 
> if your PHP 
> RPM is configured as an Apache module that could explain the problems 
> you had.
> 
> Daniel
> -- 
> ------------------------------------------------------------
>   Daniel Morissette               dmorissette at dmsolutions.ca
>   DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------
> 
> 




More information about the MapServer-users mailing list