Body: <p>We use an upgrade shell script to manage version and we're always getting this error:</p>
  <pre><code>In Bootstrap.php line 57:
                                                                                                                                                                                                                      
    Failed to locate civicrm.settings.php. By default, this tool searches the parent directories for a standard CMS (Drupal, WordPress, etal) and standard civicrm.settings.php. Symlinks and multisite configuratio  
    ns may interfere. To customize, set variable CIVICRM_SETTINGS to point to the preferred civicrm.settings.php.  
  </code></pre>
  <p>Our script installs from a zip not clones from git.</p>
  <p>I've tried to hard set the path to the <code>civicrm.settings.php</code> file with different flavours of (here for WordPress in wp-config.php)</p>
  <pre><code>  // define CiviCRM constants here
  if ( ! defined( 'CIVICRM_SETTINGS' ) ) {
        define( 'CIVICRM_SETTINGS', dirname( __FILE__ ) . '/wp-content/uploads/civicrm/civicrm.settings.php' );
    }
  </code></pre>
  <p>Same for Drupal. I could only find these 2 <code>Bootstrap.php</code> files but none had a line 57 that could point to this error.</p>
  <pre><code>./httpdocs/wp-content/plugins/civicrm/civicrm/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php
  ./httpdocs/wp-content/plugins/civicrm/civicrm/vendor/markbaker/complex/classes/Bootstrap.php
  </code></pre>
  <p>Any idea?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-07-08T12:01:07.743Z
Comments.Text: Are you using cv? Bootstrap probably means this https://github.com/civicrm/cv/blob/2996f8e1429131e2052c1cd2d46a04f3e610b346/lib/src/Bootstrap.php#L174
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-07-09T14:54:07.703Z
Comments.Text: yes we're using cv to launch DB and ext upgrades. You're right this is exactly the output. 
  CIVICRM_SETTINGS_PATH and CIVICRM_SETTINGS are both already declared in the wp-config.php file.
  How can we address this situation?
Comments.UserDisplayName: Guillaume Sorel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-07-09T15:51:05.193Z
Comments.Text: First make sure you're using the latest version of `cv`. Then also note that depending on what command you're running it may not boot the cms, so it might not be loading your wp-config.php. But my guess is you're running the shell script from a folder outside the site's tree. So you can either have the script do a `cd` into the site's folder, and then it should find civicrm.settings.php, or you can set `export CIVICRM_SETTINGS=/path/to/civicrm.settings.php` in the shell script.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-07-11T07:54:11.467Z
Comments.Text: I think `cv` is up-to-date. The script itself runs from outside the site's tree but in the script we're doing a `cd`. We'll try to add `export CIVICRM_SETTINGS=/path/to/civicrm.settings.php` it seems promising
Comments.UserDisplayName: Guillaume Sorel
Tags: <upgrade>
Title: Bootstrap error after upgrading
ThreadText: # Bootstrap error after upgrading
  
  (Asked by: username_0 on 2024-07-08)
  
  We use an upgrade shell script to manage version and we're always getting this error:
  
  ```
  In Bootstrap.php line 57:
                                                                                                                                                                                                                      
    Failed to locate civicrm.settings.php. By default, this tool searches the parent directories for a standard CMS (Drupal, WordPress, etal) and standard civicrm.settings.php. Symlinks and multisite configuratio  
    ns may interfere. To customize, set variable CIVICRM_SETTINGS to point to the preferred civicrm.settings.php.  
  
  ```
  
  Our script installs from a zip not clones from git.
  
  I've tried to hard set the path to the `civicrm.settings.php` file with different flavours of (here for WordPress in wp-config.php)
  
  ```
    // define CiviCRM constants here
  if ( ! defined( 'CIVICRM_SETTINGS' ) ) {
        define( 'CIVICRM_SETTINGS', dirname( __FILE__ ) . '/wp-content/uploads/civicrm/civicrm.settings.php' );
    }
  
  ```
  
  Same for Drupal. I could only find these 2 `Bootstrap.php` files but none had a line 57 that could point to this error.
  
  ```
  ./httpdocs/wp-content/plugins/civicrm/civicrm/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php
  ./httpdocs/wp-content/plugins/civicrm/civicrm/vendor/markbaker/complex/classes/Bootstrap.php
  
  ```
  
  Any idea?
  
  **Tags:** upgrade
  
  > **Comments:**
  > **username_1**: Are you using cv? Bootstrap probably means this https://github.com/civicrm/cv/blob/2996f8e1429131e2052c1cd2d46a04f3e610b346/lib/src/Bootstrap.php#L174  
  > **username_0**: yes we're using cv to launch DB and ext upgrades. You're right this is exactly the output.  CIVICRM_SETTINGS_PATH and CIVICRM_SETTINGS are both already declared in the wp-config.php file. How can we address this situation?  
  > **username_1**: First make sure you're using the latest version of `cv`. Then also note that depending on what command you're running it may not boot the cms, so it might not be loading your wp-config.php. But my guess is you're running the shell script from a folder outside the site's tree. So you can either have the script do a `cd` into the site's folder, and then it should find civicrm.settings.php, or you can set `export CIVICRM_SETTINGS=/path/to/civicrm.settings.php` in the shell script.  
  > **username_0**: I think `cv` is up-to-date. The script itself runs from outside the site's tree but in the script we're doing a `cd`. We'll try to add `export CIVICRM_SETTINGS=/path/to/civicrm.settings.php` it seems promising  
  
  ---
  
  ## 0 answers
  
  