1

I'm trying to get WordPress running off of a plain Digital Ocean Ubuntu droplet. I'm running Apache, and it serves basic index.html files fine, from my /var/www/html directory. When I unzip the latest WordPress version from https://wordpress.org/latest.zip and place the contents in the html directory, it's just serving the PHP code but not running it.

<?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 have a MySQL server running on that droplet as well, with the same wp-config.php files that I have locally in my /Sites directory(same WordPress configuration that works locally). I've sudo apt-get installed mysql, php, and apache2.

Apologies if this is too host-specific, but I feel like its probably a basic misunderstanding of how to get WordPress running off Apache with Ubuntu, rather than anything Digital Ocean related. Also seems like I'm just forgetting to download some package.

  • So you mean that Apache is just outputting your php file just like an HTML file? – Jack Johansson Feb 12 '17 at 5:24
  • yea. i have apache v.2.4.18 and php v.7.0.13, if that makes a difference – heliotrope Feb 12 '17 at 5:26
  • Checkout this answer. It might help you. – Jack Johansson Feb 12 '17 at 5:28
1

Simple mistake. Needed to make sure I installed the correct php module for apache, which is libapache2-mod-php7.0. I had installed one for a previous version of php.

| improve this answer | |
  • But you already said another version of your WordPress is working with php – Jack Johansson Feb 12 '17 at 7:03
  • It was working locally, on my macbook(should have specified that). The same wordpress install wasn't working on the server. I hadn't configured the remote server correctly. – heliotrope Feb 12 '17 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.