Store PHP variables in memory between script executions

How can I store variables in server RAM between scripts and even between different sessions?

Do I need to install some kind of extension or is it somehow built into PHP?

+6
source share
2 answers

There are several options:

Memcache http://memcached.org/ extension. This is a RAM based storage engine.

APC APC - PHP manual Apc cache code allows you to store variables.

If you do not want any extensions, you can store your data in a file (serialize or XML format), and this will be persistent data. Slower than memory.

, " " . MySQL, SQLite NOSQL MongoDB ...

+7

apc_store() apc_add(), apc_fetch() . , $_SESSION , . GLOBAL , .

0

All Articles