[mapserver-users] Workaround for image caching problems in php_mapscript
Daniel Morissette
morissette at dmsolutions.ca
Wed Oct 31 07:49:51 PST 2001
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
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list