[Mapserver-users] basic PHP mapscript config

Paul Spencer spencer at dmsolutions.ca
Wed Feb 26 18:11:06 EST 2003


Eric, another option which seems to work and is portable is to use 
forward slashes ...

$map_path="c:/program files/oracle/ora81/apache/apache/htdocs/mapserver/";

also you should be aware that on Windows the filesystem is not case 
sensitive but on Linux it is.

finally, you should note that when using php filesystem functions (like 
realpath) on windows, the path separator is \.  We typically pass all 
paths through a function that does any conversion and concatenation in a 
safe way.

Cheers,

Paul

Daniel Berstein wrote:
> You should use double backslashes for your path like:
> 
> $map_path="C:\\Program Files\\Oracle\\ora81\\Apache\\Apache\\htdocs\\MapServer\\";
> 
> 
> Regards,
> 
> Daniel Berstein Z.
> Jefe de Proyectos, dmapas.com
> Eduardo Hyatt 583, Providencia, Santiago CHILE
> *(56) (2) 222 22 60
> 
> 
> -----Mensaje original-----
> De:	Eric Hillmuth [SMTP:ehillmuth at digitalmeridian.net]
> Enviado el:	Miercoles, 26 de Febrero de 2003 14:43
> Para:	mapserver-users at lists.gis.umn.edu
> Asunto:	[Mapserver-users] basic PHP mapscript config
> 
> I'm trying to set up PHP mapscript (the 3.7 build from DM Solutions)  
> with Apache on an NT box. I'm following the howto at:
> 
> http://mapserver.gis.umn.edu/doc/phpmapscript-byexample-howto.html
>  <http://mapserver.gis.umn.edu/doc/phpmapscript-byexample-howto.html>
> 
> Unfortunately I keep getting this php error:
> 
> Parse error: parse error, unexpected T_VARIABLE in
> C:\Progra~1\oracle\ora81\Apache\Apache\htdocs\mapserver\Index.php on 
> line 5
> 
> My php file looks like this:
> 
>         <?php
>         dl('php_mapscript_37.dll');
> 
>         $map_path="C:\Program
>         Files\Oracle\ora81\Apache\Apache\htdocs\MapServer\";
>         $map = ms_newMapObj("$map_path.UPgeneral.map");
> 
> 
>         $image=$map->draw();
>         $image_url=$image->saveWebImage(MS_PNG,1,1,0);
> 
> 
>         ?>
> 
>         <HTML>
>         <HEAD>
>         <TITLE>Example 1: Displaying a map</TITLE>
>         </HEAD>
>         <BODY>
>         <IMG SRC=<?php echo $image_url; ?> >
>         test
>         </BODY>
>         </HTML>
> 
> And my mapfile looks like this
> 
> NAME UPGeneral
> SIZE 400 400
> STATUS ON
> SYMBOLSET ./Symbols/Symbols.sym
> EXTENT 2935998 1144674 3315772 1376879
> UNITS FEET
> SHAPEPATH "\Shape\"
> 	
> WEB
> 	IMAGEPATH "/MapServer/ImageTemp"
> 	IMAGEURL "/MapServer/"
> END
> 
> LAYER
> 	NAME PLSS Sections
> 	TYPE POLYGON
> 	STATUS ON
> 	DATA Sections
> 	CLASS
> 		COLOR 110 50 100
> 		OUTLINECOLOR 200 200 200
> 	END
> END
> 
> END
> 
> Any thoughts would be appreciated. <http://mapserver.gis.umn.edu/doc/phpmapscript-byexample-howto.html>
> 

-- 
Paul Spencer
Applications and Software Development
DM Solutions Group Inc.
http://www.dmsolutions.ca





More information about the mapserver-users mailing list