Ah! I see the problem now. I just assumed you were running over a browser, but I see now that you are needing to run the generateSitemap.php file from the command line.
It's like the error message said, on DreamHost, PHP5 is "installed
in a different path from PHP 4".
Try the following command line:
..and you should be good to go.
php generateSitemap.php will run the DreamHost installed mod_php version of PHP4.4.7; you have to specify a full path to the appropriate pgp.cgi to run either the cgi version of PHP4 or PHP5 from the command line (your Domain setup in the Control Panel handles it for your browser based calls).