Heino Kuhn, making his debut at the age of 33, could do little about a textbook delivery that swung a touch and left him off the seam before taking the edge on its way to Alastair Cook at first slip. It was though a further blow to South Africa, who will have fellow paceman Kagiso Rabada suspended for the second Test next week for using "inappropriate language" on the opening day.
The former England captain scored unbeaten 59 to take England's lead past 200 after they bowled out South Africa for 361 runs in the first innings and took a 97-run lead.
Philander made an 80-ball fifty before he was last man out slogging at Ali, who finished with impressive figures of four for 59 in 20 overs.
Ali became the second fastest Englishman to take 100 wickets and score 2000 runs doing it in 38 Tests.
On day 3, South Africa's hopes will rest on Bavuma and Quinton de Kock as they look to wipe out the huge deficit. Elgar followed his England counterpart in leading the way with the bat but Broad and Moeen winkled out a wicket apiece during the middle session.
The stylish Bavuma and De Bruyn, in only his second Test, began tentatively, but gradually blunted the England attack.
Morne Morkel and Rabada kept the openers quiet early on and Cook twice survived a review for leg before.
It was the fast bowler's first fifty in almost four years.
Tenda Bavuma and Theunis de Bruyn put on a 99-run stand for the fifth wicket to lead South Africa's recovery, looking compact defensively and hitting the bad balls, but De Bruyn nicked James Anderson behind in the fifth-to-last over of the day to set back the tourists once again.
Root's dismissal failed to turn the momentum, however, as Stuart Broad's fluent and unbeaten half-century propelled the hosts past 450 before James Anderson was dismissed after hitting only his third six in worldwide cricket. Although South Africa can deploy a substitute fielder in Philander's absence, the substitute is not permitted to bowl under the Laws of Cricket.
Following Root's magnificent knock, Moeen and Broad picked up two wickets as South Africa ended the day on 214/5, still trailing the hosts by 244 runs.
Vernon Philander should have made it three in quick succession when he trapped Broad, who was on four. I've probably bowled a bit safe the previous year or so, and today's the first day I went back to an attacking mindset.
When Broad broached JP Duminy's defences South Africa were 104 for four and in trouble.