2 min read Sep 26, 2026

WordPress Homepage Shows PHP Code Instead of the Site

If your homepage shows the raw contents of index.php, the server is not running PHP for that folder. Here is how to restore the PHP handler and fix it.

FimuroHost Team

FimuroHost Team

Technical Writer

Share Article

Instead of your WordPress homepage, the browser shows lines of code starting with <?php, or offers to download index.php. This means the web server is not processing PHP files in that folder, so it sends them as plain text.

The cause is almost always a missing or damaged PHP handler in the .htaccess file, often after a plugin, migration or manual edit rewrote the file.

Security note: while the problem lasts, visitors may be able to read files such as wp-config.php if they are served as text. Fix it promptly and consider changing your database password afterwards.

Fix 1: Re-save your PHP version in StackCP

  1. Log in to your FimuroHost client area, go to Services, select your hosting plan and click Login to Control Panel / StackCP.
  2. Open the PHP version setting for the site.
  3. Select one of the current PHP 8.x versions supported by your plugins and theme, and save.
  4. Reload your site in a private browser window.

Saving the version rewrites the handler block in .htaccess, which fixes most cases.

Fix 2: Add the handler to .htaccess yourself

  1. Open the File Manager in StackCP (or connect with SFTP).
  2. Go to your document root, the folder that contains wp-config.php (usually public_html). Enable showing hidden files if you cannot see .htaccess.
  3. Download a copy of .htaccess as a backup.
  4. Edit the file and check the very top. It should start with a PHP version block like this:
    #+PHPVersion
    #="phpXX"
    AddHandler x-httpd-phpXX .php
    #-PHPVersion
    Here XX stands for the PHP version without the dot. Older sites may show php74 (PHP 7.4), which is out of date.
  5. If the block is missing, broken or duplicated further down, put a single correct block at the very top, keep the WordPress rules (# BEGIN WordPress … # END WordPress) below it, and save.

Tip: the simplest way to get the exact correct block for your chosen version is Fix 1, then compare with your backup copy.

Still not working?

  • Clear the CDN cache in StackCP (Edge Caching → Purge Everything) so an old plain-text copy is not being served.
  • Check for other .htaccess files in subfolders that set a different handler.
  • Confirm the file is really named index.php and not index.php.txt or similar.

Need help?

If anything here does not work as described, our team is happy to take a look. Open a support ticket from your FimuroHost client area or message us on WhatsApp at 01818160926.

FimuroHost Team

Written by

FimuroHost Team

Technical Writer