3

I've readed in some blogs that apache and php_cli don't share APC data because are running in different processes...

But, I need use the same data cached in Apache (user in browser) and cron processes (php_cli).

How to do it?

I've tried to access some keys from php_cli and it really can't get it.

Some idea?

1 Answer 1

5

It's not possible using APC's data cache. The data is in shared memory that is only available inside Apache. The only alternative would to be use some sort of external storage. Depending on your exact needs, this could be as simple as a text file, or as complex as a relational database, NoSQL database, or other key-value store like memcached.

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

4 Comments

What's the best NoSQL or file cache solution for PHP?
It depends on what sort of data you want to store.
Don't forget memcache as an option. If the OP had believed APC to be an option for shared data store, then using memcache should be perfectly viable with minimal code changes
@Mark: That is indeed true -- but depending on the data, another solution may be better although it may involve more code changes. It's hard to say for certain without more information :-)

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.