I downloaded a huge database-driven website focus on living organisms from www.catalogueoflife.org I installed it on my Mac, and the home page displays properly, but none of the links work. I can’t get any feedback from their support e-mail address, so I decided to try and troubleshoot it myself (though the code looks WAY over my head).
Anyway, I can access the home page at http://col2013ac/
There’s a series of links that let you choose a language (English, Spanish, Russian, etc.). They work; if I click Spanish, all the text changes to Spanish.
However, if I click any of the other links, like http://col2013ac/browse/tree, I get this message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Could that indicate a faulty connection with my database, or does it suggest another problem?
The site is installed on my Mac at /Applications/MAMP/htdocs/col2013ac and the database is at /Applications/MAMP/db/mysql/CoL2013ac
Even if this isn’t the immediate problem, I’d like to learn how to manipulated and modify this website, including moving the database to a new location.
So I did a search for “database connection” and got several hits. I posted snippets of code from several files in hopes that someone might be able to give me a clue about what’s going on here. I assume the name of the database is CoL2013ac, but how can I found out the username and password? If I can figure that out, then maybe I can figure out how to replace them with my own username and password.
Or have I opened a can of worms that I’ll probably never be able to work with without learning a new program (e.g. Zend)?
Thanks.
// libray/Zend/Db/Adapter/Abstract.php
protected $_defaultProfilerClass = 'Zend_Db_Profiler';
/**
* Database connection
*
* @var object|resource|null
*/
protected $_connection = null;
/////////////////
protected function _checkRequiredOptions(array $config)
{
// we need at least a dbname
if (! array_key_exists('dbname', $config)) {
/** @see Zend_Db_Adapter_Exception */
require_once 'Zend/Db/Adapter/Exception.php';
throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'dbname' that names the database instance");
}
if (! array_key_exists('password', $config)) {
/**
* @see Zend_Db_Adapter_Exception
*/
require_once 'Zend/Db/Adapter/Exception.php';
throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'password' for login credentials");
}
if (! array_key_exists('username', $config)) {
/**
* @see Zend_Db_Adapter_Exception
*/
require_once 'Zend/Db/Adapter/Exception.php';
throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'username' for login credentials");
}
}
/**
* Returns the underlying database connection object or resource.
* If not presently connected, this initiates the connection.
*
* @return object|resource|null
*/
public function getConnection()
{
$this->_connect();
return $this->_connection;
}
// /library/Zend/Db/Table/Row/Abstract.php
/**
* Setup to do on wakeup.
* A de-serialized Row should not be assumed to have access to a live
* database connection, so set _connected = false.
*
* @return void
*/
public function __wakeup()
{
$this->_connected = false;
}
// /library/Zend/Db/Table/Rowset/Abstract.php
/**
* Setup to do on wakeup.
* A de-serialized Rowset should not be assumed to have access to a live
* database connection, so set _connected = false.
*
* @return void
*/
public function __wakeup()
{
$this->_connected = false;
}
// /library/Zend/Test/PHPUnit/DatabaseTestCase.php
abstract class Zend_Test_PHPUnit_DatabaseTestCase extends PHPUnit_Extensions_Database_TestCase
{
/**
* Creates a new Zend Database Connection using the given Adapter and database schema name.
*
* @param Zend_Db_Adapter_Abstract $connection
* @param string $schema
* @return Zend_Test_PHPUnit_Db_Connection
*/
protected function createZendDbConnection(Zend_Db_Adapter_Abstract $connection, $schema)
{
return new Zend_Test_PHPUnit_Db_Connection($connection, $schema);
}
/**
* Convenience function to get access to the database connection.
*
* @return Zend_Db_Adapter_Abstract
*/
protected function getAdapter()
{
return $this->getConnection()->getConnection();
}
// /library/Zend/Test/PHPUnit/Db/DataSet/QuerDataSet.php
class Zend_Test_PHPUnit_Db_DataSet_QueryDataSet extends PHPUnit_Extensions_Database_DataSet_QueryDataSet
{
/**
* Creates a new dataset using the given database connection.
*
* @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection
*/
public function __construct(PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection)
{
if( !($databaseConnection instanceof Zend_Test_PHPUnit_Db_Connection) ) {
require_once "Zend/Test/PHPUnit/Db/Exception.php";
throw new Zend_Test_PHPUnit_Db_Exception("Zend_Test_PHPUnit_Db_DataSet_QueryDataSet only works with Zend_Test_PHPUnit_Db_Connection connections-");
}
$this->databaseConnection = $databaseConnection;
}