php template not displaying .map file

Bill Binko bill at BINKO.NET
Tue Oct 4 02:42:44 EDT 2005


Absolutely correct: there are solutions around this though.  I believe
Apache can be configured to take the output from mapserver and send it 
through PHP.  This kind of chaining is tricky, but it does work.  I 
believe the trick is having the CGI (mapserv or a wrapper) return an 
appropriate MIME type althought I'm not sure how at the moment.

Another alternative (that I've actually used) is to have the template go 
to a simple HTML pages that does a META refresh a full URL that includes 
the needed parameters for the PHP to work.  That is, you make a template 
that just does a 302 forward.  The client double-pumps and fetches your 
PHP file which Apache handles normally.  This requires no reconfiguraiton 
of Apache and works without having to use Mapscript.

Bill

On Tue, 4 Oct 2005, Daniele Margotti wrote:

> CGI Mapscript takes the template, substitutes the [variables] with
> values that are calculated on basis of current map view, and output this
> new HTML to the browser.
> 
> It does not process PHP files (or PHP instruction): this is only made by
> Apache (i.e.: if PHP page is requested to Apache, directly from the
> address bar of the web browser).
> 
> 	Daniele
> 
> 
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
> Behalf Of Oliver Ishmael
> Sent: Monday, October 03, 2005 5:55 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] php template not displaying .map file
> 
> 
> Dear all,
> 
> My final question is a little more troublesome, in fact i have been 
> struggling with it for well over 6 months now...
> 
> I currently have a webpage written in .php (embedded in html) that i am 
> using as my .map web template.
> 
> At the moment, when the php/html file is loaded this only displays the
> html 
> formatting and an empty mapserv window, despite the .map file
> referencing 
> the use of links1.1.php file as the template.:
> http://localhost/tm/links1.1.php
> 
> When I include various extra map parameters in the browser address bar,
> it 
> just displays the map in a new browser window:
> http://localhost/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/tm/World_TM
> .map&layer=Africa&mode=browse
> &program=/cgi-bin/mapserv.exe&web_map_template=links1.1.php
> 
> If anyone could shed some light on the issues i am facing i would be
> very 
> grateful! I could include the scripts as an attachment if it would help?
> 
> 
> Cheers
> Olly
> 
> _________________________________________________________________
> MSN Messenger 7.5 is now out. Download it for FREE here. 
> http://messenger.msn.co.uk
> 
> 



More information about the mapserver-users mailing list