Problems with Displaying a Map (PHPMapScript)

Karin Kampitsch Karin_Kampitsch at GMX.AT
Thu Nov 30 04:08:15 EST 2006


Dear List,

I want to display my mapfile "wkwms.map" in the internet explorer, but unfortunately there exists some problems.
I use Apache Version 2.2.3 , MapServer 4.10.0 and PHP 5.2.0.

The Code PHP/Mapscript of "wanderkarte.php" looks like this.

<?php

dl ("php_mapscript.dll");

$map_path="/ms4w/Apache/htdocs/maps/";
$map_file = "wkwms.map";
$map = ms_newMapObj($map_path.$map_file);        

$map->selectOutputFormat("png");
$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>



When i want to call the url: http://localhost/maps/wanderkarte.php, the following error message appears.

selectOutputFormat("png"); $image=$map->draw(); $image_url=$image->saveWebImage(); ?>  > 


In the the error.log of Apache: the following message appears:
"The given path misformatted or contained invalid characters: Cannot map GET /maps/<?php HTTP/1.1 to file, referer: http://localhost/maps/wanderkarte.php"

The web section in the mapfile "wkwms.map" looks like this:
TEMPLATE "index_wms.html"
IMAGEPATH "C:/ms4w/tmp/ms_tmp/"
IMAGEURL "C:/ms4w/tmp/ms_tmp/"

The Alias Section in the httpd.conf file looks like this:

Alias /ms_tmp/ /ms4w/tmp/ms_tmp/

<Directory "/ms4w/tmp/">
    AllowOverride None
    Options All
    Order allow,deny
    Allow from all
</Directory>


I really do not know, what path could be missing or is incorrect! I also tried to put other Alias, but this also did not work.

First I did not had "$map->selectOutputFormat("png");" in the php-file.
The error message before adding the selectOutputFormat was:
$image=$map->draw(); $image_url=$image->saveWebImage(); ?>  > 

Has anybody an idea? This would be very nice!

Regards, 

karin


-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!



More information about the mapserver-users mailing list