最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Site downloads files instead of loading them

programmeradmin4浏览0评论

Until two days ago the site was working fine. Yesterday, I've done nothing to it and now when I try to go to the web site it downloads a file that contains:

<?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' );

I've already tried changing the name of the plugin and theme directory to see if the problem comes from there but it didn't helped, I've also tried to rename the .htaccess file but it won't regenerate and I've also verified permissions and they are fine.

Until two days ago the site was working fine. Yesterday, I've done nothing to it and now when I try to go to the web site it downloads a file that contains:

<?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' );

I've already tried changing the name of the plugin and theme directory to see if the problem comes from there but it didn't helped, I've also tried to rename the .htaccess file but it won't regenerate and I've also verified permissions and they are fine.

Share Improve this question edited Jan 26, 2020 at 19:05 Robert-Nicolae Solca asked Jan 26, 2020 at 18:57 Robert-Nicolae SolcaRobert-Nicolae Solca 31 silver badge3 bronze badges 1
  • I would contact your host. It seems like your server is delivering your site's PHP files as downloads, rather than processing them. This wouldn't be an issue with WordPress. – Jacob Peattie Commented Jan 28, 2020 at 8:14
Add a comment  | 

2 Answers 2

Reset to default 1

Sounds to me like PHP is not running on your system, or (perhaps) an older version of PHP.

But you can check PHP status by creating a simple PHP file with the command

phpinfo();

in it and loading that page in your browser. That should show you the current settings of PHP, if it is running. And perhaps check with your hosting support to see what they say.

There are many googles/bings/ducks about how to ensure PHP is running on your server. I'd start there.

The decision to process or download files, as you've described, is often a function of your http server rather than wordpress.

Has your host made any changes to your server configuration? Has PHP been recently upgraded?

Make certain your PHP Handler is configured correctly. Also verify all files associated with Wordpress are present and haven't been removed via malicious software.

A google search yields lots of results, nearly all being an issue with the http server.

Google Search Results

I'd have left this as a comment but I'm so new here I can't leave comments.

发布评论

评论列表(0)

  1. 暂无评论