In PHP is there such a thing as memory sharing, so that all PHP processes have access to objects/values stored in the main memory area (if there's such a thing in PHP)?
I'm asking this because there's a conf file my application will include. However, I think it's a waste of resources if every single PHP script call requires this file to be opened, read, and closed. It'd be more efficient if it is included once, stored in memory, and fetched by all relevent PHP scripts when requested.
Memory sharing?
Moderator: General Moderators
There are shared memory functions, see http://de2.php.net/manual/en/ref.sem.php
But you would have to code the behaviour for all scripts yourself. That's not worthwhile.
Maybe some kind of cache (holding the parsed scripts as needed in memory) is more suitable for you, see http://us2.php.net/apc and http://www.zend.com/products/zend_platform
But you would have to code the behaviour for all scripts yourself. That's not worthwhile.
Maybe some kind of cache (holding the parsed scripts as needed in memory) is more suitable for you, see http://us2.php.net/apc and http://www.zend.com/products/zend_platform