When ever is used for emphasis after how or why, it should be written as a separate word. Thus it is correct to write how ever did you manage? rather than however did you manage? (as distinct from other uses of the adverb however, which is always written as one word). With other words such as what, where, and who, the situation is not clear-cut: both two-word and one-word forms (both what ever and whatever, and so on) are well represented, and neither is regarded as particularly more correct than the other.