How to create a shared object between different sessions in PHP?
I'm thinking of using file or MySQL memory table. Using file isn't a good option because it doesn't have locking and is slow. Using MySQL memory table is a good option, but how to save class instances (objects) to a table? Serializing an object and put it to table is also slow.
Option 1: MySQL memory table
Option 2: shm_attach,shm_detach,shm_get_var,shm_has_var,shm_put_var,..
Option 3: Memcache
The problem is using MySQL memory table requires querying. Memcache is not included in standard PHP installation. To have shm_* functions on Windows, it's required to get PHP built from source with option "--enable-sysvsem", and this requires setting in php.ini where developer may not be able to access all the time.
Which one of the above is the better? Any other options?