[mapserver-users] Error on mapserver

ciskazza at tiscali.it ciskazza at tiscali.it
Wed Jul 10 07:15:19 PDT 2013


Hi !!
I have a problem  with my mapserver 
I have installed the 
mapserver 6.2.1 and have make the test with result : "No query 
information to decode. QUERY_STRING is set, but empty"..so my 
installation is ok 
I have installed also the MapScript and have create 
2 file as to verify : test.php and province.map , but I have a serious 
problem .

PS: The library 'php_mapscript.so'  is installed in the 
directory where there are the library of php


the file test.php :
<?
php
// dl('php_mapscript.so');
$map_path="/var/www/html/TCR/map/";


$map = ms_newMapObj($map_path."province.map");

// Let's see all the 
records:

$map->setextent(-1,2823039,56501,6022882);
$image=$map-
>draw();
$image_url=$image->saveWebImage();

?>

<HTML>
   <HEAD>
      
<TITLE>Example 1: Displaying a map</TITLE>
  </HEAD>
  <BODY>
      
<IMG SRC=<?php echo $image_url; ?> >
  </BODY>
 </HTML>


The file 
province.map  :
NAME "Europe in purple"
SIZE 400 400
STATUS ON
EXTENT 
277679.0098 4067180.7913 1318975.2968 5226899.0089
UNITS METERS

SHAPEPATH "/var/www/html/TCR/map/italia/"
IMAGETYPE PNG
INTERLACE FALSE

WEB
    IMAGEPATH "/usr/local/wwwssl/TCR/map/img/"
    IMAGEURL 
"/TCR/map/img/"
END
LAYER
    NAME "1"
    TYPE POLYGON
    STATUS ON

    DATA "prov2010_s"
    CLASSITEM 'COD_PRO'
    CLASS
        
EXPRESSION "1"
        STYLE
            COLOR 255 255 255
            
OUTLINECOLOR 50 50 50
            SYMBOL 0
        END
    END
END

LAYER
    NAME "2"
    TYPE POLYGON
    STATUS ON
    DATA "prov2010_s"

    CLASSITEM 'COD_PRO'
    CLASS
        EXPRESSION "2"
        STYLE

            COLOR 255 255 255
            OUTLINECOLOR 50 50 50

            SYMBOL 0
        END
    END
END


On the bowser I make to 
call the file test.php ,but i received an error ...so i make see the 
file log of the server .
In the file "error_log" there is : 
 PHP 
Warning:  ms_newMapObj(): [MapServer Error]: msLoadMap(): First token 
must be MAP, this doesn't look like a mapfile.\n in 
/var/www/html/TCR/map/test.php 
PHP Fatal error:  Uncaught exception 
'MapScriptException' with message 'Failed to open map file 
"/var/www/html/TCR/map/province.map", or map file error.' in 
/var/www/html/TCR/map/test.php:8\nStack trace:\n#0 
/var/www/html/TCR/map/test.php(8): ms_newMapObj('/var/www/html/T...')
\n#1 {main}\n  thrown in /var/www/html/TCR/map/test.php on line 8

Why 
? 





Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale più di uno spot in TV. Per ogni nuovo abbonato 30 € di premio per te e per lui! Un amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.it/



More information about the MapServer-users mailing list