1
votes

I have a website... imaspy.com... and I am having trouble using the Zend Framework I have uploaded to my hosting account.

Please go to my website and try to become a registered user (you can use fake information) and see the error that I receive. Here is the error:

Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/92/5336292/html/imaspy/scripts/library.php on line 5

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader/Autoloader.php' (include_path='.:/usr/local/php5/lib/php:mikerader.com/ZendFramework/library') in /home/content/92/5336292/html/imaspy/scripts/library.php on line 5

Here is the code I am using for library.php. (not the real password)

// Adjust the path to match the location of the library folder on your system
$library = 'mikerader.com/ZendFramework/library/';
set_include_path(get_include_path() . PATH_SEPARATOR . $library);
require_once('Zend/Loader/Autoloader.php');
try {
    Zend_Loader_Autoloader::getInstance();
    $write = array('host'     => 'imaspy.db.5336292.hostedresource.com',
                   'username' => 'imaspy',
                   'password' => 'password123',
                   'dbname'   => 'imaspy');
    $read  = array('host'     => 'imaspy.db.5336292.hostedresource.com',
                   'username' => 'imaspy',
                   'password' => 'password123',
                   'dbname'   => 'imaspy');

    // Comment out the next two lines if using mysqli
    // and remove the comments from the last two lines
    $dbWrite = new Zend_Db_Adapter_Pdo_Mysql($write);
    $dbRead = new Zend_Db_Adapter_Pdo_Mysql($read);

    //$dbWrite = new Zend_Db_Adapter_Mysqli($write);
    //$dbRead = new Zend_Db_Adapter_Mysqli($read);
} catch (Exception $e) {
    echo $e->getMessage();
}
2

2 Answers

3
votes

Here is your bug:

$library = 'mikerader.com/ZendFramework/library/';

You need to use a path on the server not a URL. Something like:

$library = $_SERVER['DOCUMENT_ROOT'] . '/path/to/zend/library';

Or, provided you have the right permissions, an absolute path would work too:

// or wherever it is
$library = '/home/content/92/5336292/html/imaspy/library/Zend'; 

Also, why are you setting two db adapter objects like that when they're both identical?

0
votes

in your php.ini

include_path = your local path to your zend library directory.

you probably don't have access to the php.ini, however you can try doing it through your .htaccess file:

php_value include_path your local path to your zend library directory.