It depends which Linux distro. you are using.
You could try: yum update php
Or: sudo apt-get install php5-cgi php5-cli
I highly recommend you test your code on 5.4 before upgrading any live server as mostly likely there might be some breaking differences (as normal with most PHP upgrades).
___________________________
Liberty Central Hotel