Are you trying to follow Standalone Installation Guide ???
Their requirements are leave out some details. First of all, their example commands assume you have superuser status. Also they don't mention if you need to run PHP as a module or if PHP-CGI is ok.
As the error message says, you don't have superuser status so you need to drop the "sudo" command. Also ignore requests to modify ownership to that of the web server user ('dhapache' at DreamHost). The reason for that is that DreamHost no longer supports running PHP as an Apache module and PHP scripts must belong to the domain user because they will be run as PHP-CGI using suexec.