It may indeed be "ugly", but it is a pretty common error when porting applications from one PHP environment to another. The clue is in the path as, obviously, there is no "catagories.class.php" in, or beneath, the the DreamHost system php-cgi binary file.
Installing it "right" might not be the issue as much as "installing it correctly for php-cgi on DreamHost" might be the issue.
The fix could be very simple,or a little more complicated, depending upon how the application you are using is written (how they set paths, use environment variables, etc.).
Your first, best bet for getting a quick fix is to contact the author of the script and provide him with access to the output of a phpinfo() running on your domain. Since he/she knows their own code, they should be able to see pretty quickly what you need to change in your setup to get it to run on DreamHost.
The next best step is to Google for the name of your app/script and DreamHost. As DreamHost has become rather large, and popular, it is highly likely someone else has already dealt with your issue with that particular application on DreamHost before, and has provided the "fix".
Another step you could try is to try to run the script under mod_php (no longer officially supported, but read the comments for a workaround) and see if that solves your initial issue. If it does, then it is likely all you will need to do to "correct" your error running PHP-CGI on DreamHost is to change an environment variable or two.
Lastly, if you share the particulars of the script you are using here, or provide enough code so that we can see how that path is derived by the application, it is likely someone on these forums could spot the change that needs to be made.