0

in order to prevent server from accessing intensively my database or filesystem, I need a memory variable, which will be accessible by all scripts regardless of session on my server. I assumed putenv/setenv (or $_ENV) can be used, but it’s not working for on my server when I do putenv in one script and I echo it in another one. Am I doing anything wrong? I found SHMOP functions as well, but they don’t work on Windows – is there anything like this, which works under both Windows and Unix/Linux? Any hint is welcome.

Marek

0

3 Answers 3

2

You could use APC to store the information locally in memory on the server, or a distributed cache like Memcache.

Sign up to request clarification or add additional context in comments.

Comments

0

How about...

  1. Create a RAMDisk
  2. write a file into the RAMDisk.

1 Comment

...and implement file locking too to avoid race conditions?
0

Use memcached.

http://memcached.org/

http://php.net/manual/en/book.memcache.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.