Organisers said the top-ranked Swiss star picked up the infection last week and will miss the $2 million event, which starts on Monday, for the second straight year.
A four-time winner in Dubai, Federer will rest for two weeks and is expected to return at Indian Wells from March 11.
"I'm hoping to be back for Indian Wells. But of course, there are no promises," Federer said. "This is something that will be finished only with proper treatment. "I've been taking it easy, relaxing as much as possible. My breathing is a bit difficult and everything feels a bit slow. I can't take any chances until I'm fit again. It could be better, it could be worse."
Jan Hernych of the Czech Republic replaces him in the main draw.
Andy Roddick, the 2008 champion, withdrew from the tournament on Saturday.
Defending champion Novak Djokovic, Australian Open runner-up Andy Murray, Nikolay Davydenko, Jo-Wilfred Tsonga and Marin Cilic are the top-10 ranked players in the field at the hardcourt event.