Stopping memory leak for PHP pages