Mel Gibson won’t be making a cameo in “The Hangover 2.”

After Internet buzz spread that helmer Todd Phillips was hoping to have Gibson in the sequel, Warner Bros. and Legendary Pictures confirmed that the idea has been nixed due to opposition from others involved in the project.

“I thought Mel would have been great in the movie, and I had the full backing of Jeff Robinov and his team,” Phillips said in a statement. “But I realize filmmaking is a collaborative effort, and this decision ultimately did not have the full support of my entire cast and crew.”

Among those upset by the prospect of Gibson appearing in the pic was “Hangover” star Zach Galifianakis. “I’m in a deep protest right now with a movie I’m working on — up in arms about something,” he said in a podcast interview with website Comedy Death Ray this month.

The uproar over a bit part reflects how significantly Gibson’s reputation was tarnished when recordings of him using racial epithets and threatening violence to his ex-girlfriend Oksana Grigorieva were widely distributed on the Web earlier this year. And that followed Gibson’s anti-Semitic outbursts in 2006 when he was arrested on suspicion of drunken driving.

“Hangover 2” is set to bow next summer.