The Blues have had an indifferent start to the season so far, and a 2-1 defeat at the hands of Crusaders saw them languishing in ninth position in the league table prior to kick-off.
However, it took them just 25 minutes to open the scoring, when Murphy's firm header was diverted into the net by Ports defender Chris Casement.
Portadown fought back gamely and found an equaliser midway through the second half when Neil McCafferty lashed home a penalty after Ryan Henderson had handled in the area.
Linfield though took the lead again ten minutes later, and this time Murphy's headed effort needed no help to find the net as he rose unmarked to power the ball past David Miskelly in the Portadown goal.
David Jeffrey's side added a third two minutes from time when Henderson scored from close range, but there was still time for more goals as Murphy again headed home before Richard Leckey added a last-gasp consolation goal just before the final whistle.
In the game at Solitude, Ballinamallard showed once again how well they are adjusting to life in the top-flight with a 1-0 victory over high-flying Cliftonville.
The Mallards secured the points in injury-time when Jason McCartney finished from close range after good work by Liam Martin.
Some of Fermanagh's finest football talent watched with pride as Ballinamallard United shocked Cliftonville with a 1-0 victory in the Danske Bank Premiership on Saturday.
John Flack in his UTV Sport blog.
Coleraine leapfrogged the Reds into the league top-spot after a 2-1 victory over Lisburn Distillery at the Coleraine Showgrounds.
David Ogilvy opened the scoring for the bannsiders with a header in the 10th minute, and Shane Lowry added a second nine minutes later.
The Whites were guilty of being wasteful in front of goal, with Gary Liggett missing two good chances before the break, but Distillery's cause was helped when Kyle McVeigh was sent off for the hosts in the 54th minute.
However, Distillery couldn't find the net until two minutes from time, when Liggett made some amends for his earlier misses with a consolation goal as Coleraine held on for an important win.
Glentoran, meanwhile, moved up to second place following a comprehensive 3-1 win away to Dungannon Swifts.
The Glens went ahead through a Jay Magee penalty in the 37th minute, but Dungannon replied in spectacular fashion just a minute later when Stephen O'Neill lashed home a fierce volley.
Glentoran's lead was restored seven minutes into the second half when Andy Waterworth was quickest to the rebound after Richard Clarke's effort had been blocked en route to goal.
Waterworth added his second of the afternoon in the 66th minute with a low drive to seal the points for Eddie Patterson's side.
Over at Mourneview Park Gary Hamilton's Glenavon secured their first points of the campaign with a surprise 1-0 victory over Crusaders.
The goal came courtesy of a neat turn and shot from Guy Bates in the 57th minute, sealing a vital win for the Lurgan blues against one of the league's form teams.
Over at the Ballymena Showgrounds Glenn Ferguson's Ballymena United staged a remarkable comeback against Donegal Celtic, coming from three goals behind to searn a 3-3 draw.
DC opened the scoring in the eighth minute when he pounced on a loose ball inside the area after a slip by team-mate Ciaran Gargan.
The second came just two minutes later courtesy of a Ryan Deans strike, and Stephen Small's side looked to have victory wrapped up just before the break when Sean Cleary got the final touch on a dangerous cross into the danger zone.
However, the hosts were not about to go down without a fight, and Allan Jenkins pulled one back from the penalty spot just after the restart after a foul on Gary Thompson.
Johnny Taylor's fine header in the 60th minute left just a goal between the sides, and the fightback was complete 12 minutes from time when Jamie Davidson forced the ball over the line following a goalmouth scramble to earn his side a share of the spoils.
Saturday's results in full:
Ballymena Utd 3-3 Donegal Celtic
Ballymena Utd: Jenkins 45 (PEN), Taylor 60, Davidson 79.
Donegal Celtic: Miskimmin 8, Deans 10, Cleary 42.
Cliftonville 0-1 Ballinamallard Utd
Ballinamallard Utd: McCartney 90.
Coleraine 2-1 Lisburn Distillery
Coleraine: Ogilby 10, Lowry 19.
Lisburn Distillery: Liggett 88.
Dungannon Swifts 1-3 Glentoran
Dungannon Swifts: O'Neill 38.
Glentoran: Magee 37 (PEN), Waterworth 52, 66.
Glenavon 1-0 Crusaders
Glenavon: Bates 57.
Portadown 2-4 Linfield
Portadown: McCafferty 70 (PEN), Lecky 90+2.
Linfield: Casement 25 (OG), Murphy 80, 90, Henderson 88.