Wrong path #1

Closed
cebe opened this Issue Dec 11, 2011 · 10 comments

Comments

Projects
None yet
4 participants
@cebe
Owner

cebe commented Dec 11, 2011

comment by zang on yiiframework http://www.yiiframework.com/extension/zendautoloader/#c6081

When I want to use this extension, I got an error:

include_once(Zend/Uri/Http.php): failed to open stream: No such file or directory

My code:

$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, $service);
$docs = new Zend_Gdata_Docs($client);
$feed = $docs->getDocumentListFeed();
$this->render('index', array('feed', $feed));

My log:

2011/12/10 21:19:13 [error] [php] include_once(Zend/Uri/Http.php): failed to open stream: No such file or directory (/var/www/modultest.dev/protected/vendors/Zend/Loader.php:146)
Stack trace:
#0 /var/www/modultest.dev/protected/vendors/Zend/Uri.php(137): loadClass()
#1 /var/www/modultest.dev/protected/vendors/Zend/Http/Client.php(305): factory()
#2 /var/www/modultest.dev/protected/vendors/Zend/Gdata/ClientLogin.php(106): Zend_Gdata_HttpClient->setUri()
#3 /var/www/modultest.dev/protected/modules/ZendTest/controllers/DefaultController.php(8): getHttpClient()
#4 /var/www/modultest.dev/framework/web/actions/CInlineAction.php(50): DefaultController->actionIndex()
#5 /var/www/modultest.dev/framework/web/CController.php(300): CInlineAction->runWithParams()
#6 /var/www/modultest.dev/framework/web/CController.php(278): DefaultController->runAction()
#7 /var/www/modultest.dev/framework/web/CController.php(257): DefaultController->runActionWithFilters()
#8 /var/www/modultest.dev/framework/web/CWebApplication.php(277): DefaultController->run()
#9 /var/www/modultest.dev/framework/web/CWebApplication.php(136): CWebApplication->runController()
#10 /var/www/modultest.dev/framework/base/CApplication.php(158): CWebApplication->processRequest()
#11 /var/www/modultest.dev/index.php(22): CWebApplication->run()

Can anyone help me?

@cebe

This comment has been minimized.

Show comment Hide comment
@cebe

cebe Dec 11, 2011

Owner

Comments from yiiframework:

CeBe
@ shark: is your Zend library under protected/vendors/Zend and is Uri/Http.php under there? Make sure you put all files in the right directories.

shark
@cebe: Yes, they are.

Owner

cebe commented Dec 11, 2011

Comments from yiiframework:

CeBe
@ shark: is your Zend library under protected/vendors/Zend and is Uri/Http.php under there? Make sure you put all files in the right directories.

shark
@cebe: Yes, they are.

@cebe

This comment has been minimized.

Show comment Hide comment
@cebe

cebe Dec 11, 2011

Owner

So how do you initialize Zend autoloader? Post your code please.

Owner

cebe commented Dec 11, 2011

So how do you initialize Zend autoloader? Post your code please.

@shark300

This comment has been minimized.

Show comment Hide comment
@shark300

shark300 Dec 11, 2011

// change the following paths if necessary
$yii=dirname(__FILE__).'/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
$app = Yii::createWebApplication($config);

Yii::import("ext.zendAutoloader.EZendAutoloader", true);

// you can load not only Zend classes but also other classes with the same naming
// convention
EZendAutoloader::$prefixes = array('Zend');

Yii::registerAutoloader(array("EZendAutoloader", "loadClass"));

$app->run();
// change the following paths if necessary
$yii=dirname(__FILE__).'/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
$app = Yii::createWebApplication($config);

Yii::import("ext.zendAutoloader.EZendAutoloader", true);

// you can load not only Zend classes but also other classes with the same naming
// convention
EZendAutoloader::$prefixes = array('Zend');

Yii::registerAutoloader(array("EZendAutoloader", "loadClass"));

$app->run();
@samdark

This comment has been minimized.

Show comment Hide comment
@samdark

samdark Dec 13, 2011

Owner

In order to use this loader one should remove all require_once from Zend files.

Owner

samdark commented Dec 13, 2011

In order to use this loader one should remove all require_once from Zend files.

@cebe

This comment has been minimized.

Show comment Hide comment
@cebe

cebe Dec 13, 2011

Owner

Alternatively you could add Yii::import('application.vendors.*'); to add that path to php include path and require_once('Zend/foo/bar.php') can find the files.

Owner

cebe commented Dec 13, 2011

Alternatively you could add Yii::import('application.vendors.*'); to add that path to php include path and require_once('Zend/foo/bar.php') can find the files.

@samdark samdark closed this Dec 14, 2011

@shark300

This comment has been minimized.

Show comment Hide comment
@shark300

shark300 Dec 15, 2011

Yii::import('application.vendors.*');

works for me, but slowly. :(

Yii::import('application.vendors.*');

works for me, but slowly. :(

@samdark

This comment has been minimized.

Show comment Hide comment
@samdark

samdark Dec 15, 2011

Owner

Well, you can do as stated in readme: strip all require_once and then try w/o import.

Owner

samdark commented Dec 15, 2011

Well, you can do as stated in readme: strip all require_once and then try w/o import.

@shark300

This comment has been minimized.

Show comment Hide comment
@shark300

shark300 Dec 15, 2011

I removed all instances of require_once yet.

I removed all instances of require_once yet.

@sajidunnar

This comment has been minimized.

Show comment Hide comment
@sajidunnar

sajidunnar Feb 12, 2012

I had same error , I was calling xmlrpc class of zend and it was stuck on this error ..
if you could help so i could gather that data bcos due to that I need to use zend framework for web services consumption

I had same error , I was calling xmlrpc class of zend and it was stuck on this error ..
if you could help so i could gather that data bcos due to that I need to use zend framework for web services consumption

@cebe

This comment has been minimized.

Show comment Hide comment
@cebe

cebe Feb 12, 2012

Owner

Hm... guess this problem has been sovled, so what exactly is your problem?

Owner

cebe commented Feb 12, 2012

Hm... guess this problem has been sovled, so what exactly is your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment