Yii with facebook question


I can not let Yii v1.1.1 r1907 work with facebook api.

OS: opensolaris

PHP: 5.2.12

FB api: latest

I created a simple webapp, and here is source.



defined('YII_DEBUG') or define('YII_DEBUG',true);

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);



Yii::app()->cache->useMemcached = true;

require_once( dirname(__FILE__) . "/protected/components/facebook-platform/php/facebook.php");

$appapikey = 'key';

$appsecret = 'secret';

$facebook = new Facebook($appapikey, $appsecret);

print $facebook->get_loggedin_user();


Then I got:

include(PEAR_Error.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory


I searched in forum, someone said php 5.2 has no such issue, I am confuse.

Any suggestions will be appreciated.

The problem is probably because facebook class is trying to include other class files. You should check out this guide page: http://www.yiiframework.com/doc/guide/extension.integration to see how to implement third party libraries into Yii.

Hi Vince

Thank you, it works.

what I did is:





( I renamed facebook.php to Facebook.php )

Yes, That’s what the guide says to do. ;)

You should not have to register a new autoload…

His not, He just unregisters the Yii autoload to successfully include the facebook api classes. And the above code is what the guide says to in this kind of situations.

Weird it worked for me without… but maybe because I tested on windows case insensitive…