The general solution is that you have some setting to indicate the current language that the message should be displayed in. Then you have a file or a database table (though this might not be good if messages about database connection errors are stored in the database - you want the error messages as easily accessible as possible - might be best to load them ALL into some cache when the app starts up) somewhere that contains all your error strings, and in multiple languages, such as:
userExists.English = "Unable to add new user, user already exist"
userExists.Spanish = "<my Spanish isn't good enough to even try>"
userExists.ClassicalMongolian = ...
Then when you throw the exception, you have something like
//currentLanguage indicates what the language of the current session is.
//the function lookupExceptionString must be able to look up the
//correct string based on the value of currentLanguage
exceptionString = lookupExceptionString(currentLanguage);
throw new Exception(exceptionString );
...But luckily for you there are frameworks that already do a lot of it. Do a web search for "php internationalization", or "php i18n", The first link I found was this:
http://php-flp.sourceforge.net/getting_started_english.htm