1

I would like to migrate another wordpress site to Linode servers. I had no errors before and is doing great except now.

Here's what I did.

  1. Back up my website’s Files
  2. Exported the WordPress Ddtabase
  3. Create the WordPress database on my new host server
  4. Edited the wp-config.php file to change MySQL name, user and password etc, my database is good with wordpress.
  5. Imported my database using mysql -p -u root wp_articles4menshealth < old.sql
  6. Uploaded the WordPress files to my new host
  7. Linking to new URL DNS zones etc...

But when I tried to access my site in my browser, it gives me the content of index.php || .htaccess and not the website with the wordpress theme itself.

Here's what shows up when I access it in my browser.

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

What am I doing wrong?

Also I'm on a LAMP server, Ubuntu 16.04LTS, php7.0, Apache/2.4.18. My old hosting is on a php5.6 does that make the error and displays the source code instead of the output? How can i get over this?

1 Answers1

2

It looks like the PHP module for Apache isn't installed, because the PHP code is displayed as raw text. Try to install and enable it:

sudo apt update
sudo apt install libapache2-mod-php7.0
sudo a2enmod php7.0
sudo systemctl restart apache2.service

Here is step-by-step guide for WP installation on Ubuntu 16.04: WordPress Installation Failed.

pa4080
  • 29,831