Replace sed with pure php.
replace apxs2 patch