Replaced system rm with PHP alternative