Website tries to download PHP file instead of opening in browser Print

  • .htaccess, apache
  • 1

There might be several ways to fix PHP file download problem, however, in most cases, this is caused due to .htaccess.

Here is how to fix it. Go to your Control Panel -> File Manager, get into your public_html folder.

In order to open .htaccess in cPanel: Click File Manager and make sure to tick Show Hidden Files (dotfiles) before clicking Go. Then the .htaccess should show up.

add the following line to it:

AddType application/x-httpd-php .php .htm .html AddHandler x-httpd-php .php .htm .html

Now simply save the file and reload your website, it should work fine now!


Was this answer helpful?

« Back

Powered by WHMCompleteSolution