are you sure the old php SO was overwritten? if it purposefully wasn't and instead another one was made, was the php CLI executable overwritten so it's now using the new one?
as for Apache, make sure you made it load the correct SO file. Use php's phpinfo() function or somesuch from a page served by apache to check what version it's using.
To avoid confusion you may with to manually purge the php installation and make install it again.