/etc/suphp/suphp.conf fills with double lines on each update
The following two lines are appended to suphp.conf on each update although they are still present: x-httpd-suphp="php:/usr/bin/php-cgi" umask=0022
The reason is that replaceLine does not check if the lines are already there. I suggest to add to the end of the foreach loop: if (!$found) { if (trim($line) == $newline) { $found = 1; } } i.e. we check for the exact appearance of the new text and if it's there we don't need to append.