mapscript map loading error

cris ricana crisricana at GMAIL.COM
Thu Jul 20 05:06:49 EDT 2006


Hi!

Here's the answer to your questions:

> - is your tmp-dir writeable for the webserver?

Yes it is. I've tested my mapserver installation successfully using
CGI forms (the itasca samples, in particular) instead of PHP
/mapscript. These CGI webpages performs well and writes their images
in a temp folder I made (/usr/local/apache2/htdocs/tmp/).


> - if you look at the source-code for the html-page in your browser, does
> it show the correct url in the image tag?

The output in the browser (as well as the source code) is simply these text:

"php_mapscript.so loaded. /usr/local/apache2/htdocs/recipe1/hello.map"

Which are text echoed from the php code (see my php code below) from
line 3 and 5. There are no lines for the image at all. Actually, I
added these text to locate where the problem is in my php code.
Otherwise, the output in the browser would be a blank page.


Regards,
Maricris






On 7/20/06, Manfred Meier <m.meier at spiekermann.de> wrote:
> Hello,
>
> - is your tmp-dir writeable for the webserver?
> - if you look at the source-code for the html-page in your browser, does
> it show the correct url in the image tag?
>
> Manfred
>
>
> cris ricana schrieb:
>
> > Hello!
> >
> > I'd like some help in using PHP/Mapscript. I have a freshly installed
> > Mapserver machine and is testing some simple php webpages to see if
> > everything is working, especially PHP/Mapscript:
> >
> >    <?php
> >          dl ("php_mapscript.so");
> >          echo("php_mapscript.so loaded.\n");   //to see if the library will
> > sucessfully load.
> >          $map_path="/usr/local/apache2/htdocs/recipe1/hello.map";
> >          echo($map_path);                             // absolute path
> > to the map file
> >        $map = ms_newMapObj($map_path);
> >        $image=$map->draw();
> >        $image_url=$image->saveWebImage();
> > ?>
> > <HTML>
> > <HEAD>
> > <TITLE>Mapserver "hello world"</TITLE>
> > </HEAD>
> > <BODY>
> > <img SRC="<?php echo $image_url; ?>">
> > <p>This is the simplest example I could come up with.</p>
> > ...
> > </BODY>
> > </html>
> >
> > I'm using the following map file. It should produce an image with just
> > a line of text in it:
> >
> > MAP
> >        NAME HELLO
> >        STATUS ON
> >        EXTENT 0 0 4000 3000
> >        SIZE 400 300
> >        IMAGECOLOR 200 255 255
> >        WEB
> >                IMAGEPATH "/usr/local/apache2/htdocs/tmp/"
> >                IMAGEURL "/tmp/"
> >        END
> >
> >        LAYER
> >                NAME "credits"
> >                STATUS DEFAULT
> >                TRANSFORM FALSE
> >                TYPE ANNOTATION
> >                FEATURE
> >                        POINTS
> >                                200 150
> >                        END
> >                        TEXT 'Hello world.  Mapserver rocks.'
> >                END
> >                CLASS
> >                        LABEL
> >                                TYPE BITMAP
> >                                COLOR 0 0 0
> >                        END
> >                END
> >        END
> >
> > END
> >
> > The output I'm getting from the browsers is just the following:
> >
> >                 php_mapscript.so loaded.
> > /usr/local/apache2/htdocs/recipe1/hello.map
> >
> > So it seems that everything is working, but only until it encounters
> > the "$map = ms_newMapObj($map_path);" line. I've checked the tmp
> > folder I've made to store the images and no images are made (no
> > surprise there). Would somebody know what the problem might be and
> > what could be the solution for this? I really, really need to know.
> >
> > Thanks,
> > Maricris
> >
>
>



More information about the mapserver-users mailing list