Problem: Redirect to install.php
Issue Description
When accessing WordPress sites deployed on DigitalOcean App Platform, users are redirected to /wp-admin/install.php with the error:
We encountered an error when trying to load your application and your page could not be served.
Example:
Root Cause
The WordPress databases still contain the original site URLs from cPanel hosting:
Database: performwritecom_wp
- siteurl: https://www.performwrite.com.au
- home: https://www.performwrite.com.au
DigitalOcean App URL: https://wordpress-performwritecom-7alzt.ondigitalocean.app
When WordPress loads, it compares the current request URL with the siteurl in the database. If they don't match, WordPress assumes it's a fresh installation and redirects to install.php.
Current URLs in All Databases
Solutions
Solution 1: Update Database URLs (Temporary for Testing)
Update the siteurl and home options in the database to match the DigitalOcean App URL:
# Example for performwritecom_wp
mysql -h wordpress-mysql-cluster-do-user-28531160-0.i.db.ondigitalocean.com \
-P 25060 -u doadmin -p"AVNS_fgu8gFvgx0amcAQ4VBt" --ssl \
-D performwritecom_wp \
-e "UPDATE xfwlw_options SET option_value='https://wordpress-performwritecom-7alzt.ondigitalocean.app' WHERE option_name IN ('siteurl', 'home');"
Solution 2: wp-config.php Override (Recommended for Multi-Environment)
Add these lines to wp-config.php BEFORE /* That's all, stop editing! */:
if (strpos($_SERVER['HTTP_HOST'], 'ondigitalocean.app') !== false) {
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
} else {
define('WP_HOME', 'https://www.performwrite.com.au');
define('WP_SITEURL', 'https://www.performwrite.com.au');
}
This allows the same database to work with both:
Solution 3: Environment Variables (App Platform)
Configure environment variables in DigitalOcean App Platform:
- Go to App Settings → Environment Variables
- Add:
Then in wp-config.php:
if (getenv('WP_HOME')) {
define('WP_HOME', getenv('WP_HOME'));
define('WP_SITEURL', getenv('WP_SITEURL'));
}
Other Potential Issues
1. Database Connection Configuration
Verify wp-config.php has correct database settings:
define('DB_NAME', 'performwritecom_wp');
define('DB_USER', 'doadmin');
define('DB_PASSWORD', 'AVNS_fgu8gFvgx0amcAQ4VBt');
define('DB_HOST', 'wordpress-mysql-cluster-do-user-28531160-0.i.db.ondigitalocean.com:25060');
define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', '');
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
2. File Permissions
Ensure WordPress can write to:
- /wp-content/uploads/
- /wp-content/cache/
- .htaccess (if needed)
3. .htaccess / Nginx Configuration
If using Apache, ensure .htaccess permalinks are correct. If using Nginx, ensure proper rewrite rules.
4. PHP Extensions
Verify required PHP extensions are installed:
- mysqli or pdo_mysql
- gd or imagick
- curl
- mbstring
- xml
- zip
Quick Fix Script
Save this as update_wordpress_url.sh:
#!/bin/bash
DB_NAME="$1"
NEW_URL="$2"
if [ -z "$DB_NAME" ] || [ -z "$NEW_URL" ]; then
echo "Usage: $0 <database_name> <new_url>"
echo "Example: $0 performwritecom_wp https://wordpress-performwritecom-7alzt.ondigitalocean.app"
exit 1
fi
DB_HOST="wordpress-mysql-cluster-do-user-28531160-0.i.db.ondigitalocean.com"
DB_PORT="25060"
DB_USER="doadmin"
DB_PASS="AVNS_fgu8gFvgx0amcAQ4VBt"
# Get the options table name
OPTIONS_TABLE=$(mysql -h "$DB_HOST" -P "$DB_PORT" -u "$DB_USER" -p"$DB_PASS" --ssl -D "$DB_NAME" -N -s -e "SHOW TABLES LIKE '%_options';" 2>/dev/null | head -1)
if [ -z "$OPTIONS_TABLE" ]; then
echo "Error: Could not find options table in database $DB_NAME"
exit 1
fi
echo "Updating siteurl and home in $DB_NAME to $NEW_URL..."
mysql -h "$DB_HOST" -P "$DB_PORT" -u "$DB_USER" -p"$DB_PASS" --ssl -D "$DB_NAME" -e "
UPDATE \`$OPTIONS_TABLE\` SET option_value='$NEW_URL' WHERE option_name IN ('siteurl', 'home');
"
echo "✅ URLs updated successfully!"
echo "Verifying..."
mysql -h "$DB_HOST" -P "$DB_PORT" -u "$DB_USER" -p"$DB_PASS" --ssl -D "$DB_NAME" -e "
SELECT option_name, option_value FROM \`$OPTIONS_TABLE\` WHERE option_name IN ('siteurl', 'home');
"
Usage:
chmod +x update_wordpress_url.sh
./update_wordpress_url.sh performwritecom_wp https://wordpress-performwritecom-7alzt.ondigitalocean.app
Recommended Approach
For Testing/Development on DO App Platform:
- Use Solution 2 (wp-config.php override) - allows both environments to work
- Keep original URLs in database unchanged
- Use environment detection to serve correct URLs
For Production Migration:
- Update DNS to point to new hosting
- Update database URLs to production domain
- Ensure proper SSL certificates
- Set up CDN for static assets
Last Updated: February 17, 2026