How to save a variable at application level(same for all users) in php which will get updated after some time?

I've tried to find about it. I've found the following solutions:

1. Implement using file handling.
2. Cache (Memcache or APC)
3. Implement using Database Support

2 is considered as best (AFAIK). (I'm not allowed to install anything on the Server)

What about other two (mentioned above) or any other options and how I can implement those? I'm bit concerned because traffic is moderately high (but the bad thing is that I still can't use any cache mechanism). We just need to save the contents of buffer of around 255 bytes at application level.

Any snippets, pointers or help of any sort would be highly appreciated.

Thanks.