Jacob, sorry for getting back to you so late on this one. Are you still able to test this 2 years later? I wonder if this may have been a Chameleon issue and not a PHP MapScript issue.
1- Can you tell us if this still happens with MapServer 5.2?
2- Does it happen only in Chameleon or can the error be reproduced with a simple PHP script like the following?
<?php
$map = ms_newMapObj("/path/to/test.map");
$img = $map->draw();
$url = $img->saveWebImage();
printf("<IMG SRC=%s WIDTH=%d HEIGHT=%d>\n", $url, $map->width, $map->height);
?>