<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<span id="result_box" lang="en"><span class="hps">Hi</span><span>, I have finally</span> <span class="hps">found the problem</span> <span class="hps">and solution.</span> <span class="hps">Thanks to</span> <span class="hps">a system administrator</span> <span class="hps atn">ubuntu (</span><span>Sergio)</span> <span class="hps">of Spain</span><span>, we have</span> <span class="hps">refined</span> <span class="hps">the code</span> <span class="hps">of</span> <span class="hps">the libraries</span> <span class="hps">of</span> <span class="hps">Chameleon</span> <span class="hps">and found</span> <span class="hps">out why</span> <span class="hps">there was</span> <span class="hps">"Error</span> <span class="hps">rendering</span> <span class="hps">map".</span><br> <span class="hps">The problem</span> <span class="hps">arose</span> <span class="hps">when the function</span> <span class="hps">fwrite</span> <span class="hps">working</span> <span class="hps atn">in "</span><span>w"</span> <span class="hps">truncated</span> <span class="hps">files</span> <span class="hps">php</span> <span class="hps">session</span><span>,</span> <span class="hps">so the</span> <span class="hps">fread</span> <span class="hps">function</span> <span class="hps">returned</span> <span class="hps">a 0</span> <span class="hps">at times.</span> <span class="hps">We assumed</span> <span class="hps">that was needed</span> <span class="hps">while</span> <span class="hps">a blocking function</span> <span class="hps">fwrite</span> <span class="hps">is writing</span> <span class="hps">so</span> <span class="hps">when looking</span> <span class="hps">at</span> <span class="hps">the code</span> <span class="hps">find</span> <span class="hps">the solution.</span> <span class="hps">Line 85</span> <span class="hps">of</span> <span class="hps">file</span> <span class="hps atn">"</span><span>session.php</span><span>" of</span> <span class="hps">chameleon</span> <span class="hps">says:</span><br><br> <span class="hps">/</span> <span class="hps">* File</span><span>-based</span> <span class="hps">locking</span> <span class="hps">session</span> <span class="hps">based</span> <span class="hps">on</span> <span class="hps">code</span> <span class="hps">Contributed by</span><br>&nbsp; <span class="hps">*</span> <span class="hps">Andreas</span> <span class="hps">Hocevar</span> <span class="hps">ahocevar@hotmail.com</span> <span class="hps">* /</span><br> <span class="hps atn">if (</span><span>isset</span> <span class="hps">($</span> <span class="hps">GLOBALS</span> <span class="hps atn">['</span><span>bLockSession</span><span>']</span><span>))</span><br>&nbsp;&nbsp;&nbsp;&nbsp; <span class="hps">$</span> <span class="hps">GLOBALS</span> <span class="hps atn">['</span><span>bLockSession</span><span>']</span> <span class="hps">= false</span><span>;</span><br><br> <span class="hps">If you change</span> <span class="hps">it to this:</span><br><br> <span class="hps">$</span> <span class="hps">GLOBALS</span> <span class="hps atn">['</span><span>bLockSession</span><span>']</span> <span class="hps">= true</span><span>;</span><br><br> <span class="hps">eliminating</span> <span class="hps">the if</span><span>,</span> <span class="hps">and</span> <span class="hps">there is no</span> <span class="hps">error</span> <span class="hps">anymore</span> <span class="hps">on</span> <span class="hps">ubuntu</span> <span class="hps">server.</span></span><br><br><br><br><br><div><div id="SkyDrivePlaceholder"></div>&gt; From: ms4w-users-request@lists.maptools.org<br>&gt; Subject: MS4W-Users Digest, Vol 97, Issue 3<br>&gt; To: ms4w-users@lists.maptools.org<br>&gt; Date: Sat, 5 May 2012 12:00:01 -0500<br>&gt; <br>&gt; Send MS4W-Users mailing list submissions to<br>&gt;         ms4w-users@lists.maptools.org<br>&gt; <br>&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>&gt;         http://lists.maptools.org/mailman/listinfo/ms4w-users<br>&gt; or, via email, send a message with subject or body 'help' to<br>&gt;         ms4w-users-request@lists.maptools.org<br>&gt; <br>&gt; You can reach the person managing the list at<br>&gt;         ms4w-users-owner@lists.maptools.org<br>&gt; <br>&gt; When replying, please edit your Subject line so it is more specific<br>&gt; than "Re: Contents of MS4W-Users digest..."<br>&gt; <br>&gt; <br>&gt; Today's Topics:<br>&gt; <br>&gt;    1. Mapserver variable session php error in Ubuntu Server<br>&gt;       (Fernando S?nchez Garc?a)<br>&gt; <br>&gt; <br>&gt; ----------------------------------------------------------------------<br>&gt; <br>&gt; Message: 1<br>&gt; Date: Fri, 4 May 2012 18:37:17 +0000<br>&gt; From: Fernando S?nchez Garc?a         &lt;nando_gcia@hotmail.com&gt;<br>&gt; Subject: [MS4W-Users] Mapserver variable session php error in Ubuntu<br>&gt;         Server<br>&gt; To: "ms4w-users@lists.maptools.org" &lt;ms4w-users@lists.maptools.org&gt;<br>&gt; Message-ID: &lt;SNT133-W55205AF82F28823D0BFADCF62C0@phx.gbl&gt;<br>&gt; Content-Type: text/plain; charset="iso-8859-1"<br>&gt; <br>&gt; <br>&gt; Hi, I hope you can help me with a problem. Some years ago I developed a <br>&gt; gis with apache + php + mapserver + postgresql + postgis + chameleon. I <br>&gt; had two systems: one in Windows XP <br>&gt; <br>&gt; 32bit and the other with Ubuntu Server 9.10 32bit. I upgraded to v3.0.2 <br>&gt; MS4W with (MapServer 5.6.6, PHP 5.3.6, Apache 2.2.17 with OpenSSL <br>&gt; 0.9.8o) with Chameleon 2.6rc, PostgreSQL 9 and PostGIS 1.5 on <br>&gt; <br>&gt; windows and have installed on the server a Ubuntu Server 11.10 64bit <br>&gt; with Mapserver 5.6.6, PHP 5.3.6-13, Apache 2.2.20, Chameleon 2.6rc, <br>&gt; PostgreSQL 9 and PostGIS 1.5.<br>&gt; <br>&gt; In windows everything works fine without any error, but in linux all the<br>&gt;  gis works well except the generation of map images. Chameleon gives me <br>&gt; the following error:<br>&gt; <br>&gt; <br>&gt; <br>&gt; "Error rendering map image:<br>&gt; <br>&gt; A fatal error has occurred restoring your session.<br>&gt; <br>&gt; Please restart the application ".<br>&gt; <br>&gt; <br>&gt; <br>&gt; This error occurs randomly, ie sometimes appear soon after starting the <br>&gt; web that maps samples and sometimes tear good maps and after interacting<br>&gt;  with buttons such as zoom, search, select layers, etc.. comes a time <br>&gt; when the error occurs.<br>&gt; <br>&gt; <br>&gt; <br>&gt; I tried to load the maps with various browsers: Internet Explorer 8 and <br>&gt; 9, Firefox 9, 11 and 12, with Chrome, etc and all the error (sometimes <br>&gt; earlier and sometimes later).<br>&gt; <br>&gt; <br>&gt; <br>&gt; I located the error message in the files of Chameleon and occurs when <br>&gt; the session is lost. After questioning the official mailing list <br>&gt; Chameleon I have not responded to or Chameleon Mapserver issue, but the <br>&gt; problem is the PHP session variables in Ubuntu that are not properly <br>&gt; read.<br>&gt; <br>&gt; I looked where the variables that make Ubuntu is in / var/lib/php5 / and when I go into the GIS files are created.<br>&gt; <br>&gt; For example the content of this folder is:<br>&gt; <br>&gt; <br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 0 05/02/2012 12:29 DELETEME<br>&gt; <br>&gt; drwxr-xr-x 2 www-data www-data 4096 02/05/2012 13:00 sess_4fa1124a4c1b0<br>&gt; <br>&gt; drwxr-xr-x 3 www-data www-data 4096 02/05/2012 13:03 sess_4fa113d58b836<br>&gt; <br>&gt; drwxr-xr-x 3 www-data www-data 4096 02/05/2012 13:28 sess_4fa11a52ecf87<br>&gt; <br>&gt; drwxr-xr-x 3 www-data www-data 4096 02/05/2012 13:30 sess_4fa11ac13d4a7<br>&gt; <br>&gt; drwxr-xr-x 3 www-data www-data 4096 8:15 sess_4fa22030ecf5a 05/03/2012<br>&gt; <br>&gt; drwxr-xr-x 3 www-data www-data 4096 8:33 sess_4fa2248dd36d3 05/03/2012<br>&gt; <br>&gt; drwxr-xr-x 2 www-data www-data 4096 8:35 sess_4fa2272b9d3c6 05/03/2012<br>&gt; <br>&gt; drwxr-xr-x 3 www-data www-data 4096 8:43 sess_4fa228e314a33 05/03/2012<br>&gt; <br>&gt; drwxr-xr-x 2 www-data www-data 4096 05/03/2012 10:00 sess_4fa23b23bcd80<br>&gt; <br>&gt; drwxr-xr-x 3 www-data www-data 4096 05/03/2012 12:29 sess_4fa25d60a2ea9<br>&gt; <br>&gt; -Rw ------- 1 www-data www-data 185 05/03/2012 12:26 sess_gmi7nemimpfsaf2lppn55m92c2<br>&gt; <br>&gt; <br>&gt; <br>&gt; And for example in the directory sess_4fa25d60a2ea9 / that is created by entering the sig files are:<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040950-15887 3/5/2012 12:29 8569.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040951-15887 3/5/2012 12:29 2414.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040951-15887 3/5/2012 12:29 3346.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040957-15887 3/5/2012 12:29 2107.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040957-15887 3/5/2012 12:29 2317.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040959-15887 3/5/2012 12:29 3372.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040959-15887 3/5/2012 12:29 7593.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040960-15887 3/5/2012 12:29 7987.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040961-15887 3/5/2012 12:29 4889.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040963-15864 3/5/2012 12:29 2339.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040963-15864 3/5/2012 12:29 2976.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040972-15948 3/5/2012 12:29 4146.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 1336040972-15948 3/5/2012 12:29 8593.map<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 128 05/03/2012 12:27 8b4b39babc2d1b7a1b23490574832862.shp<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 108 05/03/2012 12:27 8b4b39babc2d1b7a1b23490574832862.shx<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 14 967 05/03/2012 12:26 mapDHTML_adjust.map<br>&gt; <br>&gt; drwxr-xr-x 2 www-data www-data 4096 05/03/2012 12:29 queryresultdir<br>&gt; <br>&gt; -Rw-r - r - 1 www-data www-data 13 898 05/03/2012 12:29 session_file<br>&gt; <br>&gt; <br>&gt; <br>&gt; I searched the internet error php session variables in linux, but what I find is not related to my problem.<br>&gt; <br>&gt; 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.<br>&gt; <br>&gt; <br>&gt; <br>&gt; Can anyone give me a clue how to fix it?                                               <br>&gt; -------------- next part --------------<br>&gt; An HTML attachment was scrubbed...<br>&gt; URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20120504/8922010f/attachment.html <br>&gt; <br>&gt; ------------------------------<br>&gt; <br>&gt; _______________________________________________<br>&gt; MS4W-Users mailing list<br>&gt; MS4W-Users@lists.maptools.org<br>&gt; http://lists.maptools.org/mailman/listinfo/ms4w-users<br>&gt; <br>&gt; <br>&gt; End of MS4W-Users Digest, Vol 97, Issue 3<br>&gt; *****************************************<br></div>                                               </div></body>
</html>