EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
WordPress Deployment Guide - DigitalOcean App Platform

Quick Start - Fixing the install.php Redirect

Problem

WordPress apps on DO App Platform redirect to install.php because database URLs don't match app URLs.

Solution

Deploy the pre-configured wp-config.php files to fix URL mismatch.


Step-by-Step Deployment

1. Generate Security Keys (Required Before Deployment)

Each WordPress site needs unique security keys. Run this script to add them:

cd /home/cw/Documents/IBG_HUB/rmm-psa-devops/wordpress-templates
./add-security-keys.sh

Or manually for each file:

  1. Visit: https://api.wordpress.org/secret-key/1.1/salt/
  2. Copy the generated keys
  3. Replace the placeholder keys in each wp-config file

2. Deploy to DigitalOcean App Platform

Option A: Via DO Console (Recommended for Testing)

  1. Go to DigitalOcean App Platform
  2. Select your app (e.g., wordpress-performwritecom-7alzt)
  3. Go to Console tab
  4. Upload the wp-config file or edit directly:
    nano wp-config.php
  5. Paste the contents from the generated config file
  6. Save and exit (Ctrl+X, Y, Enter)
  7. App will automatically restart

Option B: Via GitHub/GitLab (For Automated Deployment)

  1. Add wp-config.php to your WordPress repository
  2. DO NOT commit to public repos - database password is in the file
  3. Use private repository or environment variables instead
  4. Push to trigger automatic deployment

Option C: Via doctl CLI

# Install doctl if not already installed
snap install doctl
# Authenticate
doctl auth init
# List apps
doctl apps list
# Get app ID for performwritecom
APP_ID="your-app-id-here"
# Deploy using app spec (create app spec with wp-config as build command)
doctl apps update $APP_ID --spec app-spec.yaml

3. Verify Deployment

After deploying wp-config.php:

  1. Visit your app URL: https://wordpress-performwritecom-7alzt.ondigitalocean.app
  2. Should see WordPress site (not install.php redirect)
  3. Test wp-admin: https://wordpress-performwritecom-7alzt.ondigitalocean.app/wp-admin
  4. Login with existing WordPress credentials

Generated Config Files

All wp-config.php files are located in:

/home/cw/Documents/IBG_HUB/rmm-psa-devops/wordpress-templates/configs/

File List (16 sites):

Config File Database Domain Status
wp-config-collegeo_wp.php collegeo_wp comsmta.org ⚠️ Needs security keys
wp-config-coomerawatersrea_wp.php coomerawatersrea_wp coomerawatersrealestate.com.au ⚠️ Needs security keys
wp-config-corne582_wp.php corne582_wp cornerstone-constructions.com.au ⚠️ Needs security keys
wp-config-handsofd_wp.php handsofd_wp www.handsofdestiny.com.au ⚠️ Needs security keys
wp-config-kandudeliveriesc_wp.php kandudeliveriesc_wp kandudeliveries.com.au ⚠️ Needs security keys
wp-config-laserxperts_wp.php laserxperts_wp laser-x-perts.com.au ⚠️ Needs security keys
wp-config-murbahmowers_wp.php murbahmowers_wp murwillumbahmowers.com.au ⚠️ Needs security keys
wp-config-murwillu_wp.php murwillu_wp murwillumbahchamber.com.au ⚠️ Needs security keys
wp-config-outdoor1_wp.php outdoor1_wp outdoorism.com.au ⚠️ Needs security keys
wp-config-path2ucom_wp.php path2ucom_wp path2u.com.au ⚠️ Needs security keys
wp-config-performwritecom_wp.php performwritecom_wp www.performwrite.com.au ⚠️ Needs security keys
wp-config-pits_wp.php pits_wp preciseitservices.com.au ⚠️ Needs security keys
wp-config-redheale_wp.php redheale_wp redhealer.com.au ⚠️ Needs security keys
wp-config-sfnm_wp.php sfnm_wp supportfornewmums.info ⚠️ Needs security keys
wp-config-soilife_wp.php soilife_wp soilifefarming.com.au ⚠️ Needs security keys
wp-config-vastcons_wp.php vastcons_wp www.vastconstructions.com.au ⚠️ Needs security keys

What Each Config File Does

  1. Database Connection: Connects to DigitalOcean MySQL cluster with SSL
  2. Environment Detection: Automatically detects if running on:
    • DO App Platform (*.ondigitalocean.app) → uses app URL
    • Production domain → uses original domain
  3. Table Prefix: Auto-detected from database (e.g., xfwlw_, wp_, etc.)
  4. Debug Mode: Enabled on staging, disabled on production
  5. Security: Forces SSL, disables file editing, enables auto-updates

Testing Checklist

After deploying each wp-config.php:

  • Site loads without install.php redirect
  • Frontend pages display correctly
  • wp-admin login works
  • Images/media display correctly
  • Plugins function properly
  • Theme displays properly
  • Forms work
  • No PHP errors in logs

Troubleshooting

Still Redirects to install.php

Check:

  1. wp-config.php uploaded correctly
  2. File permissions are correct (644)
  3. Environment detection logic is working
  4. Database connection is successful

Debug:

// Add to wp-config.php temporarily to see current environment
var_dump($_SERVER['HTTP_HOST']);
var_dump(WP_HOME);
var_dump(WP_SITEURL);
die();

Database Connection Errors

Check:

  1. Database credentials are correct
  2. SSL is enabled (MYSQLI_CLIENT_SSL)
  3. MySQL cluster is accessible from App Platform
  4. Database name matches exactly

Test connection:

// Add before require_once ABSPATH . 'wp-settings.php';
$link = mysqli_connect(
DB_HOST,
DB_USER,
DB_PASSWORD,
DB_NAME,
null,
null,
MYSQL_CLIENT_FLAGS
);
if (!$link) {
die('Database connection failed: ' . mysqli_connect_error());
}
echo 'Database connected successfully!';
mysqli_close($link);
die();

White Screen / 500 Error

Check:

  1. PHP syntax errors in wp-config.php
  2. File permissions
  3. App Platform logs for error details

View logs:

doctl apps logs $APP_ID --type=run

Next Steps After Deployment

  1. ✅ Deploy wp-config to all 16 apps
  2. ✅ Test each app
  3. 🔄 Set up DigitalOcean Spaces CDN
  4. 🔄 Migrate static assets to CDN
  5. 🔄 Update DNS to point to App Platform
  6. 🔄 Add sites to RMM dashboard

Security Notes

⚠️ IMPORTANT:

  1. DO NOT commit wp-config.php files to public repositories (database password is in plain text)
  2. DO use environment variables for sensitive data in production
  3. DO generate unique security keys for each site
  4. DO keep .gitignore updated to exclude wp-config.php
  5. DO rotate database passwords periodically

Support Resources


Last Updated: February 17, 2026