Comprehensive Installation Troubleshooting, Error Reference, SSL/Rewrite Fixes & Migration Rescue Guide
Encountered an issue during or after installing Keystone X? This complete diagnostic reference explains how to read /error.log, how the Branded Error Shield works, and provides step-by-step fixes for every common server, database, URL rewrite, license validation, PDF logo, and SMTP email error.
1. How Keystone X Logs Errors (/error.log & SystemErrorHandler.php)
For security reasons, Keystone X never exposes raw PHP stack traces or SQL credentials to the browser (display_errors = 0). Instead, app/core/SystemErrorHandler.php intercepts every warning, exception, or fatal error and performs three actions automatically:
- Writes a Detailed Diagnostic Entry to
/error.log: Open/error.login your project root (or/app/error.log) to see the exact timestamp, Error Reference ID, PHP file and line number, HTTP request URI, authenticated user, and last executed SQL query with bound parameters. - Displays the Branded Keystone X Error Shield: Shows a clean, reassuring screen to the user with the incident reference code.
- 1-Click Helpdesk Diagnostic Dispatch: Administrators can navigate to
admin/settings#systemand click Send System Diagnostics (admin/sendDiagnostics) to attach/error.logdirectly to a support ticket on the Keystone X Helpdesk!
2. Fixing 404 Page Not Found / Broken Clean URLs (.htaccess & Nginx)
Symptom: The home page or login screen loads at /, but clicking any link (like /user/login, /invoice/index, or /admin/settings) returns an Apache/Nginx 404 Not Found error.
Cause A: Hidden .htaccess File Was Not Uploaded
On macOS/Linux and in cPanel File Manager, files starting with a dot (.htaccess) are hidden by default. Enable Show Hidden Files (dotfiles) in cPanel File Manager and verify that .htaccess exists in your project root alongside index.php.
Cause B: Incorrect RewriteBase in a Subfolder
If your app URL is https://yourdomain.co.za/billing/, open .htaccess and change RewriteBase / to RewriteBase /billing/. Conversely, if your app is on a subdomain (https://billing.yourdomain.co.za/), ensure RewriteBase / is set.
Cause C: Apache mod_rewrite Disabled on a VPS
On a fresh Ubuntu/Debian VPS, enable mod_rewrite and set AllowOverride All in your Apache VirtualHost:
Cause D: Running on Nginx (No .htaccess Support)
Add the following location blocks inside your Nginx server { ... } block:
3. Fixing Database Connection & SQL Strict Mode Errors
SQLSTATE[HY000] [2002] No such file or directorywhenDB_HOSTislocalhost: ChangeDB_HOSTinapp/config/config.phpfrom'localhost'to'127.0.0.1'. Using'127.0.0.1'tells PHP PDO to connect over standard TCP/IP port 3306 instead of looking for a missing Unix socket file (mysql.sock).SQLSTATE[HY000] [1045] Access denied for user: On cPanel servers, remember that both your Database Name and Database Username are prefixed with your cPanel account name (e.g.,cpaneluser_keystone, not justkeystone). Also verify in cPanel → MySQL Databases that the user has been added to the database with ALL PRIVILEGES.SQLSTATE[HY000] [2006] MySQL server has gone awayduring Large Backups or Imports: Increasemax_allowed_packet = 64Mandwait_timeout = 600in your MySQLmy.cnf/my.iniconfiguration.
4. Fixing License Server Connection & Lock Screen Issues
- "Connection to the remote license server failed or invalid response":
- Verify that the
php-curlextension is enabled on your server. - Verify that your server can reach
https://keystonex.co.zaon outbound TCP port443(curl -I https://keystonex.co.za). - On local Windows development environments (AMPPS / XAMPP / WampServer), if cURL fails with an SSL CA certificate error (
cURL error 60: SSL certificate problem: unable to get local issuer certificate), downloadcacert.pemfromhttps://curl.se/ca/cacert.pemand setcurl.cainfo = "d:\AMPPS\php82\extras\ssl\cacert.pem"in yourphp.ini.
- Verify that the
- "Domain mismatch or license already bound to another installation": When migrating Keystone X from a staging URL to your live domain, log into your Licensing Portal at
https://keystonex.co.za(or contact Keystone X Support) to reissue/rebind your domain fingerprint, then delete/cache/license.jsonso your server fetches a fresh token immediately.
5. Fixing Blank PDFs, Missing Logos & Outbound SMTP Failures
PDF & Company Logo Troubleshooting
- Company Logo Not Showing on PDFs: Ensure the PHP
gdextension is enabled (php -m | grep gd) and re-upload your logo as a standardPNGorJPGunderadmin/settings#branding. Keystone X usesget_pdf_logo_base64()to embed the image directly into the PDF stream so no external HTTP loopback request is required. - Corrupted or Blank PDF Downloads: Never add a closing
?>tag or trailing blank lines toapp/config/config.php(index.phpautomatically healsconfig.phpif a closing tag is detected). Also ensurememory_limitis at least256M.
Outbound SMTP & Email Queue Troubleshooting
- Emails Stuck in
PendinginsideEmailQueue/index: Ensure your scheduled Cron Job (cron_runner.phporcron.php) is active, or click Process Spool Batch Now inEmailQueue/index?mode=spool. - Emails Moving to
Dead-Letter Queue (Failed): OpenEmailQueue/index?mode=dead_letterand inspect theerror_msgcolumn. Common causes: using a normal account password instead of an App Password on Google Workspace / Microsoft 365 with 2FA enabled, or picking Port465withTLSinstead ofSSL(use Port587withTLSor Port465withSSL). - Master Kill-Switch Check: Verify under
admin/settings#emailthat Disable Automated Outbound Emails (disable_automated_emails) is unchecked.
6. Quick-Reference Error Message Lookup Table
| Exact Error Message Displayed | Where It Originates | Immediate Resolution |
|---|---|---|
System Error: Configuration file not found and installation wizard is missing. |
index.php (Line 35) |
Neither app/config/config.php nor install/index.php exists. Restore app/config/config.php from backup or upload the /install folder to run the wizard. |
Security Lockout: Login is not allowed until the /install directory is either deleted or renamed. |
UserController.php (Line 62) |
Click the red Yes, Delete /install Now button on the login screen, or delete/rename /install via cPanel File Manager. |
license.key not found or not writable. |
AdminSettingsTrait.php (Line 486) |
Set permissions (chmod 755 or 775) on /app/config/ and chmod 644 (or 664) on /app/config/license.key and /cache/. |
CRON_ERROR: Access Denied. Invalid or missing Security Key. |
cron.php (Line 174) |
When calling cron.php via HTTP/cURL, append ?key=YOUR_SECRET_KEY copied from admin/cron?mode=setup (or use cron_runner.php via CLI). |
CRON_RUNNER ERROR: No active admin user found in database. |
cron_runner.php (Line 38) |
Ensure at least one user in the users table has role = 'admin'. |