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

Tim Sutton sutton_t at giug.net
Wed Oct 31 11:45:54 EST 2001


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
>
>




More information about the mapserver-users mailing list