Fatal error: Maximum execution time of 240 seconds exceeded in sites/all/modules/memcache/memcache.inc on line 353
Set max_execution_time = 0 in php.ini to allow unlimited execution times, and disable the set_time_limit() PHP function (also via php.ini) to prevent Drupal from self-limiting its execution time back to 240 s. Otherwise, you would have to find all the places where Drupal calls set_time_limit() and increase the values there or set them to zero.

(In Drupal 7, this got simpler through the new drupal_set_time_limit() wrapper function, which will not call set_time_limit() at all if the current time limit is 0 (unlimited). To be exact, this works since Drupal 7.40, and before was prevented by issue #2233929.)