PEAR namespace collisions ("Cache")
| Project: | Cache Router |
| Version: | 6.x-1.0-beta8 |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Hello,
Thank you for making this module it seems to be very good. Only its not working for me for some reason.
Here are the errors I get :
Warning: Cache::include_once(Cache/Container/cache.php) [function.Cache-include-once]: failed to open stream: No such file or directory in D:\xampp\php\PEAR\Cache.php on line 135
Warning: Cache::include_once() [function.include]: Failed opening 'Cache/Container/cache.php' for inclusion (include_path='.;D:\xampp\php\pear\') in D:\xampp\php\PEAR\Cache.php on line 135
Fatal error: Class 'Cache_Container_cache' not found in D:\xampp\php\PEAR\Cache.php on line 136
The issue seems to be in "include_once(Cache/Container/cache.php)" part. That file does not exist in that directory. I even tried to copy 2 different cache.php files there but I just get errors that some functions cant be re declared.
Do I have different version of PEAR ?
Please help I would really like to make this module work.
PS I followed the installation instructions and patched files since I'm working on drupal 5.7

#1
I too have this problem, If anyone knows how to fix it please let me know. I'm using XAMPP to develop my drupal 6.6 based website.
#2
I don't have a windows box to test this on. It seams that you have a PEAR class called Cache when what it is really looking for is a custom class called "Cache" in the cacherouter directory.
I will try to get this into the queue and test on windows. The only work-around I can suggest is opening up CacheRouter.php and changing line #2 to
<?phprequire './Cache.php';
see if that helps.
Best,
Steve
#3
that didnt help
Warning: require(./Cache.php) [function.require]: failed to open stream: No such file or directory in E:\Webserver\xampp\htdocs\drupal6\sites\all\modules\cacherouter\CacheRouter.php on line 2
Fatal error: require() [function.require]: Failed opening required './Cache.php' (include_path='.;E:\Webserver\xampp\php\pear\') in E:\Webserver\xampp\htdocs\drupal6\sites\all\modules\cacherouter\CacheRouter.php on line 2
#4
I had this exact same problem, but I was able to get it to work by editing CacheRouter.php and putting in a full path to the correct include file, starting from root:
require '/home/www/OMG_PATH/LOL/sites/all/modules/cacherouter/Cache.php';
It's exactly what you said, my host is desparatly attempting to use PEAR's cache instead of the local cache.
I'm not a Drupal Coding Pro, but would it be too hard to change the internal library name, so you're including "CacheRouter_Cache.php" as the library file? This would solve the PEAR conflict...
#5
I don't use the local wamp server much cause it's so slow.
I really would like to be able to make use of this mod on a live site or 2...
Every time i tried it over the last few months, has the error
#6
I had this exact same problem on a xampp server
#7
I had the same problem. Filling in the complete path in the require solved it for me, too.
#8
I had the same error for a XAMPP based project on Windows Server 2003
I applied a more generic fix to CacheRouter.php
require dirname(__FILE__).'/Cache.php';This avoids the namespace collision with the PEAR class.
#9
Fixed in all branches. Thanks!
#10
Automatically closed -- issue fixed for 2 weeks with no activity.