WordPress site downloading a file instead of displaying after moving from hosting

Known:

.htaccess file content from source hosting:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-alt-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

Destination hosting using ea-php72

The download file content is:

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

Problem:

The .htaccess code for the php version is appending by cpanel, how to make it … ?

Solution:

  • Go to your cpanel and login
  • Select Software->MultiPHP Manager
  • Change your php version to lower than 72 and click Apply button
  • After success change it again to 72 version and click Apply button
  • Check if .htacess is contain this code
 php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

Result:

Open your wordpress site again and it should be display the content

Thanks for reading

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *