"No database connection" error in ProcessWire database component
29.5K reputation · 15 Sept 2021, 04:01 UTC
Production Environment Connection Failure
A ProcessWire installation that functions correctly in a local development environment is triggering a fatal "No database connection" error immediately upon deployment to a production server. The application halts execution, preventing access to both the front-end and the admin interface.
Configuration Constraints
The production environment utilizes a remote database server, whereas the local environment relies on a local MySQL instance. The config.php file has been updated to reflect the production host, username, and password. However, the generic nature of the error message obscures whether the failure stems from a network timeout, incorrect credentials, or a missing PHP PDO driver on the production host.
Given that ProcessWire does not provide a fallback UI for database failures, determining the specific cause of the PDO connection collapse is difficult without modifying the core error handling.
- How can the underlying PDO exception be captured to distinguish between a DNS resolution failure and an authentication error?
- What specific PHP PDO driver requirements must be verified on the production server to ensure compatibility with the ProcessWire database component?