Sites moved but won't load an hour later

Pinging @james

Expected behavior

Go to a website public page and see the home page

Current behavior

I get a prompt to download a file called “download”

Possible solution

Steps to reproduce

Provide a link to a live example, or an unambiguous set of steps to reproduce
this bug. Include code to reproduce, if relevant.

  1. https://classicpress.club
  2. https://cpforks.com
  3. https://hostwithaussie.com

Context

The downloaded file contains:

<?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.

Looks like apache is misconfigured. It is serving your homepage as application/x-httpd-php instead of running it and serving text/html.

1 Like

@Simone

But they were working fine when I moved them. Was able to login, update my plugins etc.

Then they all just went kaput?

Can you use php from command line?

Do you mean in cPanel? This is simply shared hosting.

https://hostwithaussie.com/ is working

https://cpforks.com/license.txt displays

did you copy ant user.ini or php.ini files over?

I think I’ve found the problem. I set the PHP version to ea-php72

But that version has gone AWOL from the server since I moved the sites.

I changed to 7.0 on the site with no CMS and the problem went away. So it’s a server issue.

Will have to wait for a reply to my ticket.

1 Like

Have you tried removing .htaccess?

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!

3 Likes

Hi Aussie,
A few possibilities to look at:

  1. 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.

  2. 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
  1. 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.

For example:

AddHandler application/x-httpd-php54 .php 

change to

# AddHandler application/x-httpd-php54 .php

Let me know if any of those may be the issue.

Cheers
Avrom

2 Likes

Per above replies it looks like this was the issue.

1 Like

No the problem was simply that 7.2 went missing after I had moved the sites. They put it, and ones higher, back and everything was working again.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.