If the package is installed via RPM, first find the name of the RPM package:
rpm -qa | grep "package"
where “package””can be “php”
Then to uninstall the RPM package use:
rpm -e name-of-rpm-package
where name-of-rpm-package is something like php-5.1.6-27.el5_5.3