if you are reading my post here its probably because you want to cache your pages.

i too wanted to cache my pages using pear cache_lite, but when i ran my script is said:

Warning: require_once(Cache/Lite.php) [function.require-once]: failed to open stream: No such file or directory in /home/web/index.php on line 54


Fatal error: require_once() [function.require]: Failed opening required 'Cache/Lite.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/web/index.php on line 54

so, what can you do to not get this error. well, the answer is simple, install Cache_Lite on the server. as you can see from my error its looking for Cache/Lite.php in my includes directory at /usr/share/pear. so when i log into my server using ssh, i run this command:

ls /usr/share/pear


i dont see the Cache files there. so to install it i run this command:
yum install php-pear-Cache


after i ran it, its starts to install the Cache system from pear:

[root@ns1 pear]# yum install php-pear-Cache
Loading "installonlyn" plugin
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package php-pear-Cache.noarch 0:1.5.5-0.1.RC4.fc7 set to be updated
--> Processing Dependency: php-pear(HTTP_Request) for package: php-pear-Cach
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package php-pear-HTTP-Request.noarch 0:1.4.2-1.fc7 set to be updated
--> Processing Dependency: php-pear(Net_URL) >= 1.0.12 for package: php-pearP-Request
--> Processing Dependency: php-pear(Net_Socket) >= 1.0.2 for package: php-peTTP-Request
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package php-pear-Net-URL.noarch 0:1.0.15-1.fc7 set to be updated
---> Package php-pear-Net-Socket.noarch 0:1.0.8-1.fc7 set to be updated

Dependencies Resolved

============================================================================
Package Arch Version Repository Size
============================================================================
Installing:
php-pear-Cache noarch 1.5.5-0.1.RC4.fc7 fedora 38
Installing for dependencies:
php-pear-HTTP-Request noarch 1.4.2-1.fc7 updates 21 k
php-pear-Net-Socket noarch 1.0.8-1.fc7 fedora 12 k
php-pear-Net-URL noarch 1.0.15-1.fc7 updates 9.5 k

Transaction Summary
============================================================================
Install 4 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 80 k
Is this ok [y/N]: y


i say yes to continue with the installation:

Downloading Packages:
(1/4): php-pear-Net-Socke 100% |=========================| 12 kB 00:00
(2/4): php-pear-Cache-1.5 100% |=========================| 38 kB 00:00
(3/4): php-pear-HTTP-Requ 100% |=========================| 21 kB 00:00
(4/4): php-pear-Net-URL-1 100% |=========================| 9.5 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: php-pear-Net-Socket ######################### [1/4]
Failed loading ../../xcache.so: ../../xcache.so: cannot open shared object file: No such file or directory
Failed loading /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: cannot open shared object file: No such file or directory
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
Installing: php-pear-Net-URL ######################### [2/4]
Failed loading ../../xcache.so: ../../xcache.so: cannot open shared object file: No such file or directory
Failed loading /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: cannot open shared object file: No such file or directory
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
Installing: php-pear-HTTP-Request ######################### [3/4]
Failed loading ../../xcache.so: ../../xcache.so: cannot open shared object file: No such file or directory
Failed loading /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: cannot open shared object file: No such file or directory
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0
Installing: php-pear-Cache ######################### [4/4]
Failed loading ../../xcache.so: ../../xcache.so: cannot open shared object file: No such file or directory
Failed loading /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: cannot open shared object file: No such file or directory
PHP Warning: Zend Optimizer does not support this version of PHP - please upgrade to the latest version of Zend Optimizer in Unknown on line 0

Installed: php-pear-Cache.noarch 0:1.5.5-0.1.RC4.fc7
Dependency Installed: php-pear-HTTP-Request.noarch 0:1.4.2-1.fc7 php-pear-Net-Socket.noarch 0:1.0.8-1.fc7 php-pear-Net-URL.noarch 0:1.0.15-1.fc7
Complete!


i do see a an error on zend optimizor but its ok, now, confirm that Cache was installed by sending this command:

ls /usr/share/pear/


now you will see the Cache directory

but there is a problem, Lite is not there. so this is the way i installed it in the Cache Directory.

download the latest Cache_Lite from the PEAR site at:
http://pear.php.net/package/Cache_Lite/ and put the files in the /usr/share/pear/Cache Directory

this is how i did it from the linux shell command.. login as root:

cd /usr/share/pear/Cache/


wget http://download.pear.php.net/package/Cache_Lite-1.7.4.tgz


after the Cache_Lite-1.7.4.tgz has been download it, untar the file
tar xvfz Cache_Lite-1.7.4.tgz


now go into the Cache_Lite-1.7.4 directory:
cd /usr/share/pear/Cache/Cache_Lite-1.7.4


now we are going to copy the necessary files for our Cache_Lite to work:

copy the Lite Directory into the Cache/ Directory
cp -rf /usr/share/pear/Cache/Cache_Lite-1.7.4/Lite/ /usr/share/pear/Cache/


copy Lite.php in the Cache/ directory:
cp /usr/share/pear/Cache/Cache_Lite-1.7.4/Lite.php /usr/share/pear/Cache/


Now that you have the necessary files for your Cache to work, run your script again and you should not see that error anymore

now, if you dont have shell access to your server, its ok, i will teach you how you can do it by clicking on the following link:


http://www.wallpaperama.com/forums/warning-require-oncecache-lite-php-function-require-once-t6911.html