Hi Luca,
here is a sample code as workaround for the strange Mapscript bug and
the tmp file names:
in map.php for function 'pmap_createMapImage()' replace
$this->mapURL = $mapImg->saveWebImage();
with
$tmpImgBaseName = session_id() . "_map_" . time() . "." .
$_SESSION["imgFormat"];
$tmpFileNameAbs = str_replace('\\', '/', $this->map->web->imagepath) .
$tmpImgBaseName ;
$this->mapURL = $this->map->web->imageurl . $tmpImgBaseName ;
$mapImg->saveImage($tmpFileNameAbs, $this->map);
It creates a tmp file name for the image based on the session id and the
time. One can can use virtually any function that with some certainty
creates a unique string.
The same would be necessary for the scalebar and all the printing stuff.
One could put everything also into a function, until the bug has been
fixed (maybe it is in fact, but I don't have a clue...)
Armin