Membership signup times out with error

Any attempt to signup or change membership results in the whole site being locked, and eventually the request times out with Premature end of script headers: index.php, referer: https://freelan*******.org/memberships/ in the error log.