Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-16265

Installing civicrm via drush civicrm-install broken

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6
    • Fix Version/s: 4.6.1
    • Component/s: None
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      We always used to install civicrm through drush with the following command.

      drush --include=sites/all/modules/civicrm/drupal/drush civicrm-install --dbname=chirocivi_civicrm --dbpass='<pass>' --dbuser=<dbuser> --destination=sites/all/modules --site_url=chirocivi.localhost

      This doesn't work anymore in civicrm 4.6 (it does in previous versions). (Installing through the UI works fine).
      This is the full stack trace.

      require_once(DB/common.php): failed to open stream: No such file or directory mysql.php:30 [warning]
      PHP Fatal error: require_once(): Failed opening required 'DB/common.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/mallezie/websites/chirocivi/sites/all/modules/civicrm/packages/DB/mysql.php on line 30
      PHP Stack trace:
      PHP 1.

      {main}

      () /home/mallezie/.composer/vendor/drush/drush/drush.php:0
      PHP 2. drush_main() /home/mallezie/.composer/vendor/drush/drush/drush.php:16
      PHP 3. Drush\Boot\DrupalBoot->bootstrap_and_dispatch() /home/mallezie/.composer/vendor/drush/drush/drush.php:76
      PHP 4. drush_dispatch() /home/mallezie/.composer/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php:46
      PHP 5. call_user_func_array() /home/mallezie/.composer/vendor/drush/drush/includes/command.inc:178
      PHP 6. drush_command() /home/mallezie/.composer/vendor/drush/drush/includes/command.inc:178
      PHP 7. _drush_invoke_hooks() /home/mallezie/.composer/vendor/drush/drush/includes/command.inc:210
      PHP 8. call_user_func_array() /home/mallezie/.composer/vendor/drush/drush/includes/command.inc:359
      PHP 9. drush_civicrm_install() /home/mallezie/.composer/vendor/drush/drush/includes/command.inc:359
      PHP 10. _civicrm_install_db() /home/mallezie/websites/chirocivi/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc:350
      PHP 11. civicrm_source() /home/mallezie/websites/chirocivi/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc:385
      PHP 12. DB::connect() /home/mallezie/websites/chirocivi/sites/all/modules/civicrm/install/civicrm.php:135
      PHP 13. include_once() /home/mallezie/websites/chirocivi/sites/all/modules/civicrm/packages/DB.php:542
      Drush command terminated abnormally due to an unrecoverable error. [error]
      Error: require_once(): Failed opening required 'DB/common.php' (include_path='.:/usr/share/php:/usr/share/pear') in
      /home/mallezie/websites/chirocivi/sites/all/modules/civicrm/packages/DB/mysql.php, line 30

      This problem seems to come from the DB and PEAR packages included with civicrm.
      The problem starts inside mysql.php wich tries to include the wrong common.php file.
      In mysql.php line 30
      require_once 'DB/common.php';

      This isn't correct since the mysql.php file is already in the DB folder. Changing this to:
      require_once 'common.php';
      fixes the first step of the problem.

      Once common.php is loaded a new problem arises at rule 30
      require_once 'PEAR.php';

      This isn't correct either since the PEAR.php file is located one folder up.
      Commenting this line fixes the problem.
      //require_once 'PEAR.php';

      (PEAR.php get's included elsewhere probably with the correct path).

      I'm not sure what happened here between civicrm 4.6 and previous versions, neither how to create a PR, since the packages folder isn't from CiviCRM itself.

        Attachments

          Activity

            People

            • Assignee:
              timotten Tim Otten
              Reporter:
              mallezie Tim Mallezie
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: