What should I do when getting an error opening required file?
Date Published: May 27, 2025
Description
| Build stage | Job | Error message | Category | Responsibility |
|---|
| Test Drupal | Test Drupal | Error: Failed opening required '/var/www/site-php/<APP>/<APP>-settings.inc' | Application | Customer |
Solution
You must update the if statement in the Cloud Platform database settings as follows:
In the settings.php file of your project, locate a statement similar to the erroneous statement. For example:
if (file_exists('/var/www/site-php')) {
require('/var/www/site-php/<APP>/<APP>-settings.inc'); }
Update the if statement to specify the complete path to the file:
if (file_exists('/var/www/site-php/<APP>/<APP>-settings.inc')) {