[MS4W-Users] MS4W-Users Digest, Vol 97, Issue 3

Fernando Sánchez García nando_gcia at hotmail.com
Fri Jun 8 05:05:31 EST 2012


Hi, I have finally found the problem and solution. Thanks to a system administrator ubuntu (Sergio) of Spain, we have refined the code of the libraries of Chameleon and found out why there was "Error rendering map".
 The problem arose when the function fwrite working in "w" truncated files php session, so the fread function returned a 0 at times. We assumed that was needed while a blocking function fwrite is writing so when looking at the code find the solution. Line 85 of file "session.php" of chameleon says:

 / * File-based locking session based on code Contributed by
  * Andreas Hocevar ahocevar at hotmail.com * /
 if (isset ($ GLOBALS ['bLockSession']))
     $ GLOBALS ['bLockSession'] = false;

 If you change it to this:

 $ GLOBALS ['bLockSession'] = true;

 eliminating the if, and there is no error anymore on ubuntu server.




> From: ms4w-users-request at lists.maptools.org
> Subject: MS4W-Users Digest, Vol 97, Issue 3
> To: ms4w-users at lists.maptools.org
> Date: Sat, 5 May 2012 12:00:01 -0500
> 
> Send MS4W-Users mailing list submissions to
> 	ms4w-users at lists.maptools.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.maptools.org/mailman/listinfo/ms4w-users
> or, via email, send a message with subject or body 'help' to
> 	ms4w-users-request at lists.maptools.org
> 
> You can reach the person managing the list at
> 	ms4w-users-owner at lists.maptools.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of MS4W-Users digest..."
> 
> 
> Today's Topics:
> 
>    1. Mapserver variable session php error in Ubuntu Server
>       (Fernando S?nchez Garc?a)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 4 May 2012 18:37:17 +0000
> From: Fernando S?nchez Garc?a 	<nando_gcia at hotmail.com>
> Subject: [MS4W-Users] Mapserver variable session php error in Ubuntu
> 	Server
> To: "ms4w-users at lists.maptools.org" <ms4w-users at lists.maptools.org>
> Message-ID: <SNT133-W55205AF82F28823D0BFADCF62C0 at phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 
> Hi, I hope you can help me with a problem. Some years ago I developed a 
> gis with apache + php + mapserver + postgresql + postgis + chameleon. I 
> had two systems: one in Windows XP 
> 
> 32bit and the other with Ubuntu Server 9.10 32bit. I upgraded to v3.0.2 
> MS4W with (MapServer 5.6.6, PHP 5.3.6, Apache 2.2.17 with OpenSSL 
> 0.9.8o) with Chameleon 2.6rc, PostgreSQL 9 and PostGIS 1.5 on 
> 
> windows and have installed on the server a Ubuntu Server 11.10 64bit 
> with Mapserver 5.6.6, PHP 5.3.6-13, Apache 2.2.20, Chameleon 2.6rc, 
> PostgreSQL 9 and PostGIS 1.5.
> 
> In windows everything works fine without any error, but in linux all the
>  gis works well except the generation of map images. Chameleon gives me 
> the following error:
> 
> 
> 
> "Error rendering map image:
> 
> A fatal error has occurred restoring your session.
> 
> Please restart the application ".
> 
> 
> 
> This error occurs randomly, ie sometimes appear soon after starting the 
> web that maps samples and sometimes tear good maps and after interacting
>  with buttons such as zoom, search, select layers, etc.. comes a time 
> when the error occurs.
> 
> 
> 
> I tried to load the maps with various browsers: Internet Explorer 8 and 
> 9, Firefox 9, 11 and 12, with Chrome, etc and all the error (sometimes 
> earlier and sometimes later).
> 
> 
> 
> I located the error message in the files of Chameleon and occurs when 
> the session is lost. After questioning the official mailing list 
> Chameleon I have not responded to or Chameleon Mapserver issue, but the 
> problem is the PHP session variables in Ubuntu that are not properly 
> read.
> 
> I looked where the variables that make Ubuntu is in / var/lib/php5 / and when I go into the GIS files are created.
> 
> For example the content of this folder is:
> 
> 
> 
> -Rw-r - r - 1 www-data www-data 0 05/02/2012 12:29 DELETEME
> 
> drwxr-xr-x 2 www-data www-data 4096 02/05/2012 13:00 sess_4fa1124a4c1b0
> 
> drwxr-xr-x 3 www-data www-data 4096 02/05/2012 13:03 sess_4fa113d58b836
> 
> drwxr-xr-x 3 www-data www-data 4096 02/05/2012 13:28 sess_4fa11a52ecf87
> 
> drwxr-xr-x 3 www-data www-data 4096 02/05/2012 13:30 sess_4fa11ac13d4a7
> 
> drwxr-xr-x 3 www-data www-data 4096 8:15 sess_4fa22030ecf5a 05/03/2012
> 
> drwxr-xr-x 3 www-data www-data 4096 8:33 sess_4fa2248dd36d3 05/03/2012
> 
> drwxr-xr-x 2 www-data www-data 4096 8:35 sess_4fa2272b9d3c6 05/03/2012
> 
> drwxr-xr-x 3 www-data www-data 4096 8:43 sess_4fa228e314a33 05/03/2012
> 
> drwxr-xr-x 2 www-data www-data 4096 05/03/2012 10:00 sess_4fa23b23bcd80
> 
> drwxr-xr-x 3 www-data www-data 4096 05/03/2012 12:29 sess_4fa25d60a2ea9
> 
> -Rw ------- 1 www-data www-data 185 05/03/2012 12:26 sess_gmi7nemimpfsaf2lppn55m92c2
> 
> 
> 
> And for example in the directory sess_4fa25d60a2ea9 / that is created by entering the sig files are:
> 
> -Rw-r - r - 1 www-data www-data 1336040950-15887 3/5/2012 12:29 8569.map
> 
> -Rw-r - r - 1 www-data www-data 1336040951-15887 3/5/2012 12:29 2414.map
> 
> -Rw-r - r - 1 www-data www-data 1336040951-15887 3/5/2012 12:29 3346.map
> 
> -Rw-r - r - 1 www-data www-data 1336040957-15887 3/5/2012 12:29 2107.map
> 
> -Rw-r - r - 1 www-data www-data 1336040957-15887 3/5/2012 12:29 2317.map
> 
> -Rw-r - r - 1 www-data www-data 1336040959-15887 3/5/2012 12:29 3372.map
> 
> -Rw-r - r - 1 www-data www-data 1336040959-15887 3/5/2012 12:29 7593.map
> 
> -Rw-r - r - 1 www-data www-data 1336040960-15887 3/5/2012 12:29 7987.map
> 
> -Rw-r - r - 1 www-data www-data 1336040961-15887 3/5/2012 12:29 4889.map
> 
> -Rw-r - r - 1 www-data www-data 1336040963-15864 3/5/2012 12:29 2339.map
> 
> -Rw-r - r - 1 www-data www-data 1336040963-15864 3/5/2012 12:29 2976.map
> 
> -Rw-r - r - 1 www-data www-data 1336040972-15948 3/5/2012 12:29 4146.map
> 
> -Rw-r - r - 1 www-data www-data 1336040972-15948 3/5/2012 12:29 8593.map
> 
> -Rw-r - r - 1 www-data www-data 128 05/03/2012 12:27 8b4b39babc2d1b7a1b23490574832862.shp
> 
> -Rw-r - r - 1 www-data www-data 108 05/03/2012 12:27 8b4b39babc2d1b7a1b23490574832862.shx
> 
> -Rw-r - r - 1 www-data www-data 14 967 05/03/2012 12:26 mapDHTML_adjust.map
> 
> drwxr-xr-x 2 www-data www-data 4096 05/03/2012 12:29 queryresultdir
> 
> -Rw-r - r - 1 www-data www-data 13 898 05/03/2012 12:29 session_file
> 
> 
> 
> I searched the internet error php session variables in linux, but what I find is not related to my problem.
> 
> I installed everything on the server with Ubuntu 10.11 32bit Ubuntu 4.12 and then with 32 and 64bit and error is the same.
> 
> 
> 
> Can anyone give me a clue how to fix it? 		 	   		  
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20120504/8922010f/attachment.html 
> 
> ------------------------------
> 
> _______________________________________________
> MS4W-Users mailing list
> MS4W-Users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ms4w-users
> 
> 
> End of MS4W-Users Digest, Vol 97, Issue 3
> *****************************************
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20120608/55ca03f5/attachment.htm 


More information about the MS4W-Users mailing list