- Log into the server as root via ssh or the console.
mkdir -p /var/cpanel/buildapache/scripts
- Create a file called phppost using a text editor vi phppost
- Add the following lines:
#AUTO PATCH FROM http://choon.net/php-mail-header.php
PHPVER=`find -type d -iname "php-*"|sed "s/.///g"`
patch -p0 < $PHPVER-mail-header.patch
- Save and quit that file.
and now the patch will be automatically applied.
When you receive spam complaints you will now be able to look at the headers of the message and view what script and site these came from. This is extremely useful because PHP runs as nobody unless phpsuexec is enabled and in a virtual environment it can be difficult trying to track down the broken script!