title: Need help with PHP web app bootstrapping error potentially related to Zend
body: <p>I am trying to get a program called OpenFISMA running on an Ubuntu AMI in AWS. The app is not really coded on the Ubuntu platform, but I am in my comfort zone there, and have tried both CentOS and OpenSUSE (both are sort of "native" for the app) for getting it working with the same or worse results. So, why not just get it working on Ubuntu? Anyway, the app is found here: www.openfisma.org and an install guide is found here: <a href="https://openfisma.atlassian.net/wiki/display/030100/Installation+Guide" rel="nofollow">https://openfisma.atlassian.net/wiki/display/030100/Installation+Guide</a> The install guide kind of sucks. It doesn't list dependencies in any coherent way or provide much of any detail (does not even mention Zend once on the entire page) so I've done a lot of work to divine the information I do have. This page provided some dependency inf (though again, Zend is not mentioned once): <a href="https://openfisma.atlassian.net/wiki/display/PUBLIC/RPM+Management#RPMManagement-BasicOverviewofRPMPackages" rel="nofollow">https://openfisma.atlassian.net/wiki/display/PUBLIC/RPM+Management#RPMManagement-BasicOverviewofRPMPackages</a></p>
  
  <p>Anyway, I got all the way through the install (so far as I could reconstruct it). I am going to the login page for the first time, and there should be some sort of bootstrapping occurring when I load the page. (I am not a programmer so I have no idea what it is doing there.) Anyway, I get a message on the web page that says: "An exception occurred while bootstrapping the application."</p>
  
  <p>So, then I go look in /var/www/data/logs/php.log and find this message: </p>
  
  <pre><code>[22-Oct-2013 17:29:18 UTC] PHP Fatal error:  Uncaught exception 'Zend_Exception' with message 'No entry is registered for key 'Zend_Log'' in /var/www/library/Zend/Registry.php:147
  Stack trace:
  #0 /var/www/public/index.php(188): Zend_Registry::get('Zend_Log')
  #1 {main}
    thrown in /var/www/library/Zend/Registry.php on line 147
  </code></pre>
  
  <p>This occurs every time I load the page. I gather there is an issue related to registering the Zend_Log variable in the Zend registry, but other than that I really have no idea what to do about it. Am I missing a package that it needs, or is this app not coded to register the variables properly? I have no clue. Any help is greatly appreciated. The application file referenced in the log message (index.php) is included below. </p>
  
  <pre><code>&lt;?php
  /**
   * Copyright (c) 2008 Endeavor Systems, Inc.
   *
   * This file is part of OpenFISMA.
   *
   * OpenFISMA is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
   * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
   * version.
   *
   * OpenFISMA is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
   * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
   * details.
   *
   * You should have received a copy of the GNU General Public License along with OpenFISMA.  If not, see
   * {@link http://www.gnu.org/licenses/}.
   */
  
  try {
      defined('APPLICATION_PATH')
          || define(
              'APPLICATION_PATH',
              realpath(dirname(__FILE__) . '/../application')
          );
  
      // Define application environment
      defined('APPLICATION_ENV')
          || define(
              'APPLICATION_ENV',
              (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')
          );
  
      set_include_path(
          APPLICATION_PATH . '/../library/Symfony/Components' . PATH_SEPARATOR .
          APPLICATION_PATH . '/../library' .  PATH_SEPARATOR .
          get_include_path()
      );
  
      require_once 'Fisma.php';
      require_once 'Zend/Application.php';
  
      $application = new Zend_Application(
          APPLICATION_ENV,
          APPLICATION_PATH . '/config/application.ini'
      );
  
      Fisma::setAppConfig($application-&gt;getOptions());
      Fisma::initialize(Fisma::RUN_MODE_WEB_APP);
  
      $application-&gt;bootstrap()-&gt;run();
  } catch (Zend_Config_Exception $zce) {
      // A zend config exception indicates that the application may not be installed properly
      echo '&lt;h1&gt;The application is not installed correctly&lt;/h1&gt;';
  
      $zceMsg = $zce-&gt;getMessage();
  
      if (stristr($zceMsg, 'parse_ini_file') !== false) {
  
          if (stristr($zceMsg, 'application.ini') !== false) {
  
              if (stristr($zceMsg, 'No such file or directory') !== false) {
                  echo 'The ' . APPLICATION_PATH . '/config/application.ini file is missing.';
              } elseif (stristr($zceMsg, 'Permission denied') !== false) {
                  echo 'The ' . APPLICATION_PATH . '/config/application.ini file does not have the ' .
                      'appropriate permissions set for the application to read it.';
              } else {
                  echo 'An ini-parsing error has occured in ' . APPLICATION_PATH . '/config/application.ini ' .
                      '&lt;br/&gt;Please check this file and make sure everything is setup correctly.';
              }
  
          } else if (stristr($zceMsg, 'database.ini') !== false) {
  
              if (stristr($zceMsg, 'No such file or directory') !== false) {
                  echo 'The ' . APPLICATION_PATH . '/config/database.ini file is missing.&lt;br/&gt;';
                  echo 'If you find a database.ini.template file in the config directory, edit this file ' .
                      'appropriately and rename it to database.ini';
              } elseif (stristr($zceMsg, 'Permission denied') !== false) {
                  echo 'The ' . APPLICATION_PATH . '/config/database.ini file does not have the appropriate ' .
                      'permissions set for the application to read it.';
              } else {
                  echo 'An ini-parsing error has occured in ' . APPLICATION_PATH . '/config/database.ini ' .
                      '&lt;br/&gt;Please check this file and make sure everything is setup correctly.';
              }
  
          } else {
              echo 'An ini-parsing error has occured. &lt;br/&gt;Please check all configuration files and make sure ' .
                  'everything is setup correctly';
          }
  
      } elseif (stristr($zceMsg, 'syntax error') !== false) {
  
          if (stristr($zceMsg, 'application.ini') !== false) {
              echo 'There is a syntax error in ' . APPLICATION_PATH . '/config/application.ini ' .
                  '&lt;br/&gt;Please check this file and make sure everything is setup correctly.';
          } elseif (stristr($zceMsg, 'database.ini') !== false) {
              echo 'There is a syntax error in ' . APPLICATION_PATH . '/config/database.ini ' .
                  '&lt;br/&gt;Please check this file and make sure everything is setup correctly.';
          } else {
              echo 'A syntax error has been reached. &lt;br/&gt;Please check all configuration files and make sure ' .
                  'everything is setup correctly.';
          }
  
      } else {
  
          // Then the exception message says nothing about parse_ini_file nor 'syntax error'
          echo 'Please check all configuration files, and ensure all settings are valid.';
      }
  
      echo '&lt;br/&gt;For more information and help on installing OpenFISMA, please refer to the ' .
          '&lt;a target="_blank" href="http://manual.openfisma.org/display/ADMIN/Installation"&gt;' .
      'Installation Guide&lt;/a&gt;';
  
  } catch (Doctrine_Manager_Exception $dme) {
  
      echo '&lt;h1&gt;An exception occurred while bootstrapping the application.&lt;/h1&gt;';
  
      // Does database.ini have valid settings? Or is it the same content as database.ini.template?
      $databaseIniFail = false;
      $iniData = file(APPLICATION_PATH . '/config/database.ini');
      $iniData = str_replace(chr(10), '', $iniData);
  
      if (in_array('db.adapter = ##DB_ADAPTER##', $iniData)) {
          $databaseIniFail = true;
      }
      if (in_array('db.host = ##DB_HOST##', $iniData)) {
          $databaseIniFail = true;
      }
      if (in_array('db.port = ##DB_PORT##', $iniData)) {
          $databaseIniFail = true;
      }
      if (in_array('db.username = ##DB_USER##', $iniData)) {
          $databaseIniFail = true;
      }
      if (in_array('db.password = ##DB_PASS##', $iniData)) {
          $databaseIniFail = true;
      }
      if (in_array('db.schema = ##DB_NAME##', $iniData)) {
          $databaseIniFail = true;
      }
  
      if ($databaseIniFail) {
          echo 'You have not applied the settings in ' . APPLICATION_PATH . '/config/database.ini appropriately. ' .
              'Please review the contents of this file and try again.';
      } else {
  
          if (Fisma::debug()) {
              echo '&lt;p&gt;'
                   . get_class($dme)
                   . '&lt;/p&gt;&lt;p&gt;'
                   . $dme-&gt;getMessage()
                   . '&lt;/p&gt;&lt;p&gt;'
                   . "&lt;p&gt;&lt;pre&gt;Stack Trace:\n"
                   . $dme-&gt;getTraceAsString()
                   . '&lt;/pre&gt;&lt;/p&gt;';
          } else {
              $logString = get_class($dme)
                         . "\n"
                         . $dme-&gt;getMessage()
                         . "\nStack Trace:\n"
                         . $dme-&gt;getTraceAsString()
                         . "\n";
  
              Zend_Registry::get('Zend_Log')-&gt;err($logString);
          }
      }
  
  } catch (Exception $exception) {
      // If a bootstrap exception occurs, that indicates a serious problem, such as a syntax error.
      // We won't be able to do anything except display an error.
      echo '&lt;h1&gt;An exception occurred while bootstrapping the application.&lt;/h1&gt;';
      if (Fisma::debug()) {
          echo '&lt;p&gt;'
               . get_class($exception)
               . '&lt;/p&gt;&lt;p&gt;'
               . $exception-&gt;getMessage()
               . '&lt;/p&gt;&lt;p&gt;'
               . "&lt;p&gt;&lt;pre&gt;Stack Trace:\n"
               . $exception-&gt;getTraceAsString()
               . '&lt;/pre&gt;&lt;/p&gt;';
      } else {
          $logString = get_class($exception)
                     . "\n"
                     . $exception-&gt;getMessage()
                     . "\nStack Trace:\n"
                     . $exception-&gt;getTraceAsString()
                     . "\n";
  
          Zend_Registry::get('Zend_Log')-&gt;err($logString);
      }
  }
  </code></pre>