Fix order of execution and correctly delete temporary php.ini file