Recently, I had installed new versions of PHP i.e. 7.3 on WHM, and mistakenly, I uninstalled PHP 5.4, 5.6, and 5.7. After that, some of my clients were experiencing this issue. As soon as I know the issue that PHP files are downloading instead of executing, it made me nervous because it is a serious issue. The public can see the code after downloading the file.
I searched on web portals, and get the solution of it. What I did to solve this issue are described below.
1. I add the Apache Handler:
Go to your CPanel > Advance > Apache Handlers and add a PHP handler
application/x-httpd-php for PHP extensions.
2. I installed PHP 5 again on WHM.
3. I enabled PHP – FPM from WHM > Software > MultiPHP Manager > System PHP-FPM Configuration.
4. I changed PHP Handlers to CGI at WHM > Software > MultiPHP Manager > PHP Handlers