Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to include the Zend Gdata module into a plugin, but this error appears on plugin activation:

include_once(Zend\Gdata\YouTube.php) [function.include-once]: failed to open stream: No such file or directory in \Zend\Loader.php on line 146

any help appreciated, thanks

I have the main plugin file in the root and then a Zend subfolder which contains the module. This was just copied from the demo app which works fine on the same XAMPP installation, so it's something to do with how WordPress includes files?

/**
* @see Zend_Loader
*/
require_once 'Zend/Loader.php';

/**
* @see Zend_Gdata_YouTube
*/
Zend_Loader::loadClass('Zend_Gdata_YouTube');
share|improve this question
1  
Needs more info. So far it simply looks like you used the wrong path. –  kaiser Jan 8 '12 at 16:52

1 Answer 1

* UPDATE * Please see at the bottom for right solution!!!

One way to solve this problem is that you use ini_set to set the path to your Zend folder.

I have the Zend folder in my current theme folder so i only need to tell path var what the path to my theme folder is. This code goes to functions.php if its in the theme you want to use it of course :)

ini_set ( 'include_path', ini_get ( 'include_path' ) . ':../:' . dirname ( __FILE__ ) . ':' );

require_once 'Zend/Loader.php';

Zend_Loader::loadClass ( 'Zend_Gdata_YouTube' );
Zend_Loader::loadClass ( 'Zend_Gdata_AuthSub' );
Zend_Loader::loadClass ( 'Zend_Gdata_ClientLogin' );

I will also share a screenshot just in case the structure is confusing anyone: As you see i have lifted Zend folder out from the ZendGdata-1.11.11 folder

(Missing enough of reputation to upload and share images directly in the post) http://i49.tinypic.com/9kqau9.png

Hope this helps :)

Edit:

Apparently i messed up a bit, the Zend folder im my case is actually in the ROOT. That mean if i enter www.mysite.com/Zend i should be able to access php files there. So, simplifying that all, Zend/ folder should not be in:

www.mysite.com/wp-content/themes/theme-name/Zend

But it should be in

www.mysite.com/Zend
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.