[Mapserver-users] basic PHP mapscript config

Dylan Keon keon at nacse.org
Wed Feb 26 12:46:45 EST 2003


You might need to use double-backslashes, since a single backslash is 
the escape character.  So try something like this:

   $map_path = "C:\\Program 
Files\\Oracle\\ora81\\Apache\\Apache\\htdocs\\MapServer\\";
   $map_file = "UPgeneral.map";
   $map = ms_newMapObj($map_path.$map_file);

Another thing you might want to do is change the forward slashes to 
backslashes in your mapfile, since you're on a Windows platform.  Maybe 
MapServer takes care of that when reading the mapfile (?) I don't know.

--Dylan


Eric Hillmuth wrote:
> 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>
> 

-- 
************************************************
  Dylan Keon
  GIS/Database Research Specialist
  Northwest Alliance for Computational
  Science and Engineering (NACSE)
  Oregon State University
  Corvallis, OR 97331
  keon at nacse.org        (541) 737-6608
************************************************




More information about the mapserver-users mailing list