The different phases of a compiler are Lexical Analysis, Syntactic Analysis or Parsing, Semantic Analysis, Intermediate Code Generation, Code Optimization, and Code Generation.