change all $(get_libdir)/php appearances in both eclass and ebuild to something like php52 change all /etc/php appearances in ebuild and eclass to sth. /etc/php53 disable mod_php (USE=-apache2) change /etc/env.d/20php5 to sth. 20php53 in ebuild