[Solution] index.php code being displayed in my WordPress homepage - but not the website

You might happen to be in a situation when your homepage displays index.php code instead of your frontpage, and here is one of the solutions for it.

The message displayed:

Error message

---

Solution:

Please go to your Document Root folder (folder where your files are, for example, wp-config.php) and locate .htaccess file.

Check if it has PHP version defined in it. If not, please add these lines on the very top of your htaccess file:

#+PHPVersion
#="php74"
AddHandler x-httpd-php74 .php
#-PHPVersion

And, Save.

Voila, your website should be running.

Best wishes,

Helmuts

 

 

  • wordpress
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Why can’t I send emails?

There are a few very common reasons why you may not be able to send emails. Are your email...

Where can I view the nameservers of a domain?

If you manage your domain name with HostMaria - Cloud and have access to it via stackcp.com you...

Do you offer WordPress CLI?

If you're using WordPress, you may wish to make use of the WP Command Line Interface (CLI) to...

What details should I use for a WordPress SMTP plugin?

The best SMTP details to use when configuring an SMTP plugin within WordPress when you're using...

What is WordPress?

Overview of WordPress WordPress is a free and open source content management system (CMS) based...