if your going to install the same version (just with more extensions), it should be as easy as shutting down the server, and recompiling with the options you want.
as for uninstalling... it depends on what flavour of linux your running. i use gentoo, so for me, its as simple as running a few commands. unfortunately this is about the only easy thing about gentoo. this os took me litterally 3 days to compile and about 6 weeks to get it running how i like.
unfortunately, most linux systems dont have this type of install/uninstall system, and for those, (as far as i know) you need to track down all the files related to php (these will be scattered fairly well through lots of directories) and delete them. linux has no registry, so this should be a safe method of removal.