PHP Fatal error: Allowed memory size of 41943040 bytes exhausted