Sites are not operational after migration from CentOS 7 and Ubuntu 20
Symptoms
After migrating from CentOS 7 or Ubuntu 20, sites running in FastCGI and CGI modes display the following errors:
- ERR_TOO_MANY_REDIRECTS for CGI;
- Internal Server Error for FastCGI.
The web server log contains errors of the following format:
cgid: error reading data from FastCGI server, referer: https://domain.con
End of script output before headers: index.php, referer:https://domain.con Causes
The suexec utility in modern distributions (AlmaLinux 8, Ubuntu 22 and above) allows running PHP in FastCGI and CGI modes only for users with a GID and UID greater than 1000.
Solution
There are two solutions:
- Create new users and transfer data using the Change website owner tool (recommended).
- Create backups of all users and their data, delete users, then restore from a previously created backup.