Porter was in his first season as coach of the Suns, who entered the All-Star break with a 28-23 record. That is ninth place in the Western Conference,
"I hired Terry because I believed he would be able to provide the balance our team needed in order to perform at a very high level," said Suns General Manager Steve Kerr.
"Unfortunately the transition from last season to this one proved to be very difficult, and we have not played to our potential. It's imperative that we move forward and do what's best for our team. Alvin has been an integral part of our successes the previous four years and knows our talent as well as anyone."
Gentry, who joined the Phoenix staff in 2004, has 20 years of NBA coaching experience, including stints as head coach with Miami, Detroit and the Los Angeles Clippers. His overall record is 177-226.
The Suns are the eighth NBA team this season to replace their head coach.
Wisconsin business offering 'therapeutic cuddling' forced to close
Newt Gingrich fires back at Mandela backlash