{{{cd /usr/portage/dev-php/mod_php/files/ wget "http://bugs.gentoo.org/attachment.cgi?id=56014&action=view" mv attachment.cgi\?id\=56014\&action\=view swf.c.patch cd ..\}}} Now open the file mod_php-4.3.11.ebuild and search for the src_unpack function. Add epatch ${FILESDIR}/swf.c.patch before the } bracket of the function. E.g: {{{ src_unpack() { multiinstwarn detectapache domsg php-sapi_src_unpack if [ "${ARCH}" == "amd64" ] ; then epatch ${FILESDIR}/mod_php-4.3.4-amd64hack.diff fi [ "${ARCH}" == "sparc" ] && epatch ${FILESDIR}/stdint.diff # bug fix for security problem - bug #39952 # second revision as the apache2 stuff was resolved upstream epatch ${FILESDIR}/mod_php-4.3.5-apache1security.diff # stop php from activing the apache config, as we will do that ourselves for i in configure sapi/apache/config.m4 sapi/apache2filter/config.m4 sapi/apache2handler/config.m4; do sed -i.orig -e 's,-i -a -n php4,-i -n php4,g' $i done epatch ${FILESDIR}/swf.c.patch } \}}} Run emerge mod_php now. Remember: All your changes (to the ebuild/patch) will be lost the next time you run emerge --sync.