I have a PHP file, say foo.php
and I am running multiple instances of the same PHP file.
php foo.php&
php foo.php&
php foo.php&
php foo.php&
I need a variable bar
inside foo.php
such that if bar is changed in one running instance, it can be updated in other instances as well.
How can I achieve this?
I tried File Processing - storing value of bar
in some random file, and reading it from there and updating the same.
From Question - "Share variables/memory between all PHP processes", I got to know about gearman. But this seems to be using an aeroplane instead of using a bike!