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 5Fatal 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();
}
Here is your bug:
You need to use a path on the server not a URL. Something like:
Or, provided you have the right permissions, an absolute path would work too:
Also, why are you setting two db adapter objects like that when they’re both identical?