views:

64

answers:

2

Im trying to use the Zend Frameworks ACL library in my code (in codeigniter) and after including the library in my controller I get this error:

Fatal error: Cannot redeclare class Zend_Acl in C:\xampp\php\PEAR\Zend\Acl.php on line 48

If I remove the include to the Zend library I get this error instead

Fatal error: Class 'Zend_Acl' not found in C:\xampp\htdocs\ISU-Cart\system\application\libraries\acl.php on line 3

Any help on this?

+1  A: 

I fixed this by going into all of the files I had and changing the

require_once 'Zend/Acl/Resource/Interface.php';

to

require_once BASEPATH .'libraries/Zend/Acl/Resource/Interface.php';

Kieran Andrews
Sounds like your PHP include path might have been a little wonky.
Inkspeak
What do you mean by this? It appears that Xammp is automatically pulling in the Zend framework and this is where the conflict occurred.
Kieran Andrews
+1  A: 

This is what is in my index.php file

set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

Notice the library instead of libraries. Maybe that's your issue.

Ballsacian1
Is this for CodeIgniter?
Kieran Andrews
Correct. Hmmm looks like PEAR shouldn't contain the zend directory.
Ballsacian1
Not sure why the Xammp project put it here, maybe for updating it? The issue is solved now.
Kieran Andrews