Is there a way to store a variable in server RAM using Apache 2 and PHP, holding it until the server shuts down? I need to store a very large array (hashmap) which should be initialized once (not once for user, for example only when the server starts) and accessed from different files.
$GLOBALS
doesn't do the global trick (I can't access $GLOBALS
variables from different files, am I doing it wrong?); $_SESSION
does it, but it's not what I need. I need to store it on the server instant access memory, losing it only when the server restarts.
Obviously, the answer is not "database", since querying the database would be slower than access an array from the RAM.
It can be easily done on a Java server, why not on Apache?