Changed to move from using exec file, to use php code.