Philander smashed 23 fours from 365 balls at Headingley to eclipse his previous test high of 156. He was eventually given out on referral, caught behind by Matt Prior by Stuart Broad.
JP Duminy made 48 not out, from 94 balls with six fours. Graeme Smith with 52 and AB de Villiers with 47 were the only other scores of note in South Africa's innings.
Broad was England's best bowler with 3-96, while James Anderson took 2-61 and Steven Finn 2-118.
Resuming the day on 262-5, South Africa went to lunch with 74 added to the total for the loss of Jacques Rudolph, stumped by Prior off Kevin Pietersen's occasional offspin.
South Africa's batsmen had to survive a hostile first hour of the morning session.
After four consecutive maidens, Petersen was given out lbw to Anderson. However, for the second time in his innings he successfully referred the call because the ball would have missed the stumps.
It still took 25 minutes and 39 balls for South Africa to score its first run of the day, a snatched single by Petersen.
The first boundary came at the end of the ninth over when Petersen uppercut the first bad ball of the day, from Anderson, to third man.
Petersen, who appeared to be struggling with a hamstring injury, passed his previous highest test score, made against New Zealand earlier this year, with successive fours off Tim Bresnan. But just as the seamers seemed to be running out of steam, the breakthrough came in the most unlikely circumstances.
With his second delivery, Pietersen produced a fiercely turning off break that spun past Rudolph and into Prior's gloves.
The dismissal was contentious with replays appearing inconclusive, but third umpire Asad Rauf denied Rudolph the benefit of the considerable doubt.
Petersen fell after half an hour of the afternoon session. After what looked like a clear edge to Broad, he was given not out by umpire Rod Tucker, but England instantly referred the call and Rauf ruled Petersen was caught behind.
Vernon Philander made 13 before he holed out to Finn to be caught on the boundary by Bresnan. But England's hopes of quickly polishing off the tail were frustrated by Morne Morkel, who brought up the 400 when he pulled Finn through midwicket.
Morkel hung around until he chipped Broad to mid-off and was caught by Cook for 19, and the innings concluded when Cook caught Imran Tahir at second slip off Anderson for 0.