<?php
/**
* Front to the ClassicPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells ClassicPress to load the theme.
*
* @package ClassicPress
*/
/**
* Tells ClassicPress to load the ClassicPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the ClassicPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
I had moved 16 sites to a new server and they were all working perfectly. I come back an hour or two later and get this behaviour.
I hadn’t touched them in the meantime, they just all suddenly give me the download prompt instead.
Edit: I just went to a site that has no CMS installed and the download file contains the index.php contents:
<?php
// Silence is golden.
So this may be a server problem and not a ClassicPress one.
On the site with no CMS, there is only index.php and .htaccess
All it contains is the PHP version number. So it changed to 7.0 and the error went away.
But on all my other sites .htaccess, user.ini and php.ini are set to 7.2. So it’s looking for a version that’s disappeared. Will just have to wait for the host to put it back.
Thanks for the ideas, I thought I was going nuts - or more nuts than I already am!
You may have a completely unrelated issue such as a software WAF that modifies htaccess (WordFence comes to mind). Just take that code out of the htaccess file if it exists.
If you didn’t match PHP versions on the migration, it may have messed up the htaccess file - so expected configurations are not loaded correctly. cPanel will place a configuration file for the PHP version. For example:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Some hosts, such as HostGator have their own PHP handlers. That handler will completely mess up the PHP configuration, and result in blank pages, and all kinds of other errors. Look for the htaccess file above public_html in root. Specifically comment out any X-Handler applications.