Question
Why does a download prompt appear upon accessing my website?
Answer
The download prompt indicates that the website content is trying to run a PHP version not installed on the server.
You can determine what versions of PHP are available for the server by running the following command:
/usr/local/cpanel/bin/rebuild_phpconf --current
An example output of this command would look like the following:
-bash-4.2# /usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php73
ea-php56 SAPI: cgi
ea-php71 SAPI: cgi
ea-php73 SAPI: suphp
ea-php74 SAPI: suphp
If a website is not using the server's default PHP version, then the PHP version would be defined inside the .htaccess in the document root. The following is an example of using grep to see if there is any ea-PHP versions is defined in the .htaccess:
-bash-4.2# grep -i ea-php /home/scrum/public_html/.htaccess
# Set the “ea-php72” package as the default “PHP” programming language.
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
In the example output here, the site is set to use PHP72; however, PHP72 is not installed on the server.
The search requirements can be different, so if you are using lsphp or alt-php version instead of ea-php, then the search may need to be adjusted to fit your environment.
Any .htaccess file can within the /home/$cpuser/ path include an AddHandler so that you may check for multiple files. The following is an example of what you can search for; however, there are various strings you can check for:
find /home/$cpuser -type f -name ".htaccess" -exec grep -iH addhandler {} \;
You can use EasyApache4 to install the PHP and any additional modules for your content for any missing PHP versions.