[mapserver-users] Workaround for image caching problems in php_mapscript

Bruno Gendron bruno_gendron at yahoo.com
Wed Oct 31 12:27:44 EST 2001


Tim and Daniel,

Same for me, as far as I know, the image-caching
problem occurs in both situation, with or without
preloading php_mapscript.so.

About the runaway process problem: on thing I did was
to turn-on output buffering in php (ob_start) at the
beginning of the script, and to flush the output at
the end (ob_end_flush). That way, php_mapscript (or
php itself, or apache) seems to close the connection
properly, although I cannot certify this either :-(

--
Bruno



 --- Tim Sutton <sutton_t at giug.net> a écrit : > Hi
> 
> I find the non-unique images are being generated
> with my scripts which
> do _not_ use php_mapscript.so as a preloaded module.
> 
> Tim
> 
> On Wed, 31 Oct 2001, Daniel Morissette wrote:
> 
> > Tim,
> >
> > I found that the non-unique images problem seems
> to happen only when we
> > load MapScript via a "extension=php_mapscript.so"
> line in php.ini ... if
> > php_mapscript.so is not preloaded then the problem
> doesn't seem to
> > happen.
> >
> > So another workaround for now is to not preload
> php_mapscript.so in
> > php.ini and use dl("php_mapscript.so") in the
> script instead.  The same
> > may apply to the runaway process problem but I
> haven't been able to
> > reproduce this one yet.
> >
> > Daniel
> >
> >
> > Tim Sutton wrote:
> > >
> > > Hi
> > >
> > > I have made a small work around for the problem
> of images being named
> > > in a non-unique way:
> > >
> > >     $url = $img->saveWebImage($gAppletImgFmt, 0,
> 0, -1);
> > >     //added by Tim to ensure images have unique
> names
> > >     mt_srand((double) microtime() * 1000000);
> > >     $randval = mt_rand();
> > >     $uniqueURL =
> substr($url,0,-4).$randval.".png";
> > >     rename ("/tmp/$url", "/tmp/$uniqueURL");
> > >     $url=$uniqueURL;
> > >
> > >     //end of changes by Tim
> > >
> > > I hope that proves useful to anyone else
> encountering the same problem
> > > :-)
> > >
> > > Tim
> >
> >
>  

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr



More information about the mapserver-users mailing list