tags:

views:

32

answers:

1

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?

+2  A: 

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.

Dave
:( It's really bad....
Tiago Gouvêa
What's the best NoSQL or file cache solution for PHP?
Tiago Gouvêa
It depends on what sort of data you want to store.
Dave
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 Baker
@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 :-)
Dave