Question
Why is a download prompt appear upon accessing my website?
Answer
If your .htaccess file has an invalid PHP handler, the PHP file will download instead of executing.
You can determine what versions of PHP are available for the server by running the following command:
/usr/local/cpanel/bin/rebuild_phpconf --current
The output would look similar to this:
[root@server]# /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, the PHP version would be defined inside the .htaccess file in the domain's document root.
Any .htaccess file under a user's account can have an AddHandler line. The following example is a command that can search for all the AddHandler lines in a user's home directory.
find /home/$cpuser -type f -name ".htaccess" -exec grep -iH addhandler {} \;
Please note that you must replace $cpuser with the cPanel username you're searching.
Comments
0 comments
Article is closed for comments.