Church Cashbook Maintenance Manual
Checklist-driven procedure for safe planned maintenance, using the 503 maintenance page and maintenance.on toggle.
⚠ Critical pre-maintenance requirement
Always create a full backup of the following before implementing any planned maintenance:
- The complete site codebase
- The database schema
- All data within the database
This backup must be taken after the system has been placed into maintenance mode (offline to users) and before any planned procedures are carried out.
Planned maintenance procedure
Overview
Planned maintenance should be handled in a controlled way to protect financial data integrity and ensure a predictable return to service.
Maintenance mode is enabled using a file-based toggle (maintenance.on) in the web root, which redirects all requests to the
standalone 503.php page.
Pre-maintenance checklist
- ☐ Confirm scope of work (e.g. deployment, DB migration, server patching).
- ☐ Confirm expected duration and, if possible, an approximate return time.
- ☐ Confirm rollback plan exists (how to revert if something fails).
- ☐ Take a verified database backup.
- ☐ Take a codebase snapshot (or confirm the release tag/commit).
- ☐ Update
/503.phpoperator settings (expected return time if known).
Enable maintenance mode
- Create an empty file in the web root:
maintenance.on. - Confirm any page now returns HTTP 503 (Service Unavailable).
- Confirm the 503 page renders correctly and does not depend on the database.
- Confirm the system is effectively read-only / unavailable to users during the maintenance window.
File and directory permissions (after install or upgrade)
After deploying new code (or changing the server configuration), ensure filesystem permissions are correct. This reduces the risk of accidental data exposure and prevents the web server from writing to application code.
⚠ Important
Run these commands from the project root (the folder that contains app/, public/, modules/).
Only change permissions on files you own. Avoid changing ownership (chown) unless you fully understand the hosting environment.
Recommended permissions
- Code directories (app/modules/public assets):
0755 - Code files (php/js/css/html):
0644 - Sensitive files (config.php, .htaccess):
0600–0644(prefer0600for config if possible) - Runtime directories (logs/, logs/exports/, public/uploads/):
0755or0750(must be writable if used)
Commands (run from project root)
# 1) Directories: read/execute for all, write for owner only
find . -type d -exec chmod 755 {} \;
# 2) Code files: readable by all, writable by owner
find . -type f -name "*.php" -exec chmod 644 {} \;
find . -type f -name "*.js" -exec chmod 644 {} \;
find . -type f -name "*.css" -exec chmod 644 {} \;
find . -type f -name "*.html" -exec chmod 644 {} \;
# 3) Sensitive files (adjust paths if config is moved outside web root)
chmod 600 app/config.php 2>/dev/null || true
find . -name ".htaccess" -exec chmod 644 {} \;
# 4) Runtime directories (only if present / used)
chmod 755 logs 2>/dev/null || true
chmod 755 logs/exports 2>/dev/null || true
chmod 755 public/uploads 2>/dev/null || true
# 5) Quick safety check: list world-writable files/dirs (should return nothing)
find . -perm -002 -ls
After running these, re-check System information (Super Admin) to confirm there are no world-writable paths and that runtime folders required by the application are writable.
PHP error display (display_errors) — production safety check
Before returning the service to users, confirm that PHP errors are not displayed in the browser. This is often enabled in development environments (useful for debugging), but it should be disabled on a live system.
⚠ Important
If display_errors is enabled in production, users may see PHP warnings and fatal errors.
These messages can reveal internal file paths and system details. This is a security risk and looks unprofessional.
Required production settings
display_errors= Off (users should not see raw PHP errors)log_errors= On (errors must be written to server logs)error_reporting= E_ALL (often shown as32767)
How to check
- Go to Admin → System information → Key PHP settings.
- Confirm
display_errorsshows Off (recommended for production). - Confirm
log_errorsis enabled and note theerror_loglocation if shown.
If correction is required
These settings are usually controlled by the server (php.ini, hosting control panel, or Apache/PHP configuration). After making changes, restart Apache/PHP if required, then re-check System information.
Final validation before returning to service
- ☐
display_errorsis Off - ☐
log_errorsis On - ☐ Custom
500.phppage renders correctly (no raw PHP errors shown)
During maintenance
- ☐ Perform planned tasks.
- ☐ Monitor server and PHP error logs for unexpected issues.
- ☐ If schema changes are performed, validate database integrity and completion.
- ☐ Keep notes of any deviations from the plan and actions taken.
Post-maintenance checklist
- Delete the
maintenance.onfile. - Confirm normal routing resumes (HTTP 200 on standard pages).
- Confirm login works.
- Confirm dashboard loads.
- Perform a quick smoke test:
- ☐ Add a test transaction (and void/remove if appropriate).
- ☐ Run a standard report (e.g. Monthly Summary).
- ☐ Check church selection and scope behaves correctly.
- ☐ Check Gift Aid (if applicable to your environment).
- Clear or reset
/503.phpoperator text ($expectedResume,$extraNote) if you set it. - Record a maintenance summary (what changed, start/end times, any issues, and confirmation of success).
Maintenance record template
Date: ____________________________
Start time: _______________________ End time: _______________________
Reason: ______________________________________________________________
Changes applied: ______________________________________________________
Backup location: ______________________________________________________
Rollback required? ☐ Yes ☐ No
Issues encountered / actions:
______________________________________________________________
______________________________________________________________