[Cartoweb-users] Mapserver failing to write images

Oliver Christen oliver.christen at camptocamp.com
Mon Mar 5 03:11:17 EST 2007


Hi Paul,
the first idea that come to my mind is the php process do not have the right to write files in the folder indicated in the error message.

concerning the 'DemoCW3' error, change the profile from production to development so you can see the details of the error, but it is most likely the same as in your 'paulproject' project.

there is something strange though, the generated images should be written in cartoweb3/generated/images/ and not in projects/paulproject/server_conf/paulproject/images/
the path were mapserver should save the image is set dynamically in ServerImages.php 

edit ServerImages.php, in the function drawMainmap, add a few print so we can see whats happening:

        if (!$msMapObj->web->imagepath) {
            $imagePath = $this->serverContext->getConfig()->webWritablePath .
                self::IMAGES_WRITE_PATH;
            $msMapObj->web->set('imagepath', $imagePath);
        }
        print "start debugging<br />";
        print_r($msMapObj->web->imagepath);
        print "<br />";

        if (!$msMapObj->web->imageurl) {
            $msMapObj->web->set('imageurl', $this->getImageBaseUrl());
        }

        print_r($msMapObj->web->imageurl);
        print "end debugging<br />";

the first print_r should output something like /Library/WebServer/documents/cartoweb3/htdocs/generated/images/
the second should be empty

and deactivate ajax mode in the client.ini file, it will be easier to debug

regards,
Oliver
  ----- Original Message ----- 
  From: Paul Shapley 
  To: cartoweb-users at lists.maptools.org 
  Sent: Sunday, March 04, 2007 11:11 PM
  Subject: [Cartoweb-users] Mapserver failing to write images


  Hello Users,

  Having problems with Mapserver trying to write images to the 'image' file. Have copied the demoCW3 project to create a new project called 'paulproject'. Could it be a missing 'plugin' or an initial image file?. I am using cartoweb 3.3.0 and Mac OS X which displays 'demoCW3' OK but brings up an error when it is initially displayed which reads:

  The page at http://localhost says:
  An error has occured. Press OK to reload this application.

  If i 'Cancel' this error once 'DemoCW3' runs with no problems (but fails to place any .png files in the images folder). If you press 'OK' the page reloads with the same recurring error.

  The 'paulproject' page produces the following conformation:

  Fatal error: Failed writing image to /Library/WebServer/documents/cartoweb3/projects/paulproject/server_conf/paulproject/images/45cb3eaa_2da_0.png 
  in /Library/WebServer/documents/cartoweb3/coreplugins/images/server/ServerImages.php on line 142 

  any ideas here most appreciated.

  regards,



  -- 
  Paul J. Shapley 


------------------------------------------------------------------------------


  _______________________________________________
  Cartoweb-users mailing list
  Cartoweb-users at lists.maptools.org
  http://lists.maptools.org/mailman/listinfo/cartoweb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20070305/57fc4fcf/attachment.html


More information about the Cartoweb-users mailing list