if you are getting this error message on your php script and you want to cache your php output into a cached file, then you are in ther right place. i will show you how you can fix this.
you are getting this error abviously because php cannot find the Lite.php file in your includes directory. but you can include it in your scripts.
so lets say i have a file called index.php and in the index.php file i have this line:
require_once('Cache/Lite.php');
require('Cache/Lite.php');
include('Cache/Lite.php');
include_once('Cache/Lite.php');
or even:
require_once('Lite.php');
require('Lite.php');
include('Lite.php');
include_once('Lite.php');
whichever you have, the reason its because PHP cannot find Lite.php in you includes directory in your PHP installation or in your website directory.
the first thing you are going to need is to download three little files from the PEAR website. the current version is 1.7.4 you can download from here:
http://pear.php.net/package/Cache_Lite/
there when you go to the download section, you will find the package. the current version is 1.7.4 so this is where i downloaded it from:
http://download.pear.php.net/package/Cache_Lite-1.7.4.tgz
once you have downloaded the package we are going to need three files from this.
Lite.php
Lite/Function.php
Lite/Output.php
now one of the challenges for beginners is that how do you open a file with a .tgz extension? this is a linux tarball file, it has been compressed, kinda like winzip (zip). i know how fraustrating it can be if you are using a windows computer and you try to open these files. but there is a solution, you can donwload PowerArchiver 6.1 from their website at:
http://www.sfsu.edu/ftp/win/utils/
by now you should have unpacked the file Cache_Lite-1.7.4.tgz there you will have a total of 5 files. depending on the version you have. but my version has 5 files and one directory
Lite/
1 = Lite.php
2 = package.xml
in the Lite/ Directory, you will have two files:
3. Output.php
4. Function.php
5. File.php
the most important files here are:
1 = Lite.php
3. Output.php
4. Function.php
so you should atleast have these
when i was running my script, this is the error i was getting:
Warning: main(Cache/Lites.php) [function.main]: failed to open stream: No such file or directory in /home/web/www/public_html/index.php on line 54
Fatal error: main() [function.require]: Failed opening required 'Cache/Lites.php' (include_path='.;/usr/phppear') in /home/web/www/public_html/index.php on line 54
when i look at line 54 of my index.php file it says:
require_once('Cache/Lite.php');
NOTE: the public_html is the root directory for my website. so in order to stop getting this error, i must have Cache/Lite.php in my webiste at:
/home/web/www/public_html/Cache/Lite.php
so login to your site using your FTP program and do the following:
* create a directory called "Cache"
* upload "Lite.php" in the "Cache" directory
* in the "Cache" directory, now create another directory called "Lite"
* in the "Lite" directory upload "Output.php"
* in the "Lite" directory upload "Function.php"
now that i have provide the files for my index.php script, it wont error out because php should be able to find the necessary files to cache whatever you are trying to cache.
i tested this out and it works fine. as you can see from this picture, i uploaded all my files correctly.
<img img src="http://www.wallpaperama.com/forums/post-images/20081223_1_ws-ftp-pro.jpg" alt="20081223_1_ws-ftp-pro.jpg">
so if you are still getting an error, you might have done semething wrong, installing php pear cache_lite is easy and straight forward. hope this helps.
https://www.wallpaperama.com/forums/warning-require-oncecache-lite-php-function-require-once-t6911.html