Are $_SESSION
variables stored on the client or the server?
Answers
Here's what worked best for me when trying to script this (in case anyone else comes across this like I did):
$ pecl -d php_suffix=5.6 install <package>
$ pecl uninstall -r <package>
$ pecl -d php_suffix=7.0 install <package>
$ pecl uninstall -r <package>
$ pecl -d php_suffix=7.1 install <package>
$ pecl uninstall -r <package>
The -d php_suffix=<version>
piece allows you to set config values at run time vs pre-setting them with pecl config-set
. The uninstall -r
bit does not actually uninstall it (from the docs):
vagrant@homestead:~$ pecl help uninstall
pecl uninstall [options] [channel/]<package> ...
Uninstalls one or more PEAR packages. More than one package may be
specified at once. Prefix with channel name to uninstall from a
channel not in your default channel (pecl.php.net)
Options:
...
-r, --register-only
do not remove files, only register the packages as not installed
...
The uninstall line is necessary otherwise installing it will remove any previously installed version, even if it was for a different PHP version (ex: Installing an extension for PHP 7.0 would remove the 5.6 version if the package was still registered as installed).
Where your statics go depends on whether they are zero-initialized. zero-initialized static data goes in .BSS (Block Started by Symbol), non-zero-initialized data goes in .DATA
The environment variables of a process exist at runtime, and are not stored in some file or so. They are stored in the process's own memory (that's where they are found to pass on to children). But there is a virtual file in
/proc/pid/environ
This file shows all the environment variables that were passed when calling the process (unless the process overwrote that part of its memory — most programs don't). The kernel makes them visible through that virtual file. One can list them. For example to view the variables of process 3940, one can do
cat /proc/3940/environ | tr ' ' 'n'
Each variable is delimited by a binary zero from the next one. tr replaces the zero into a newline.
Never used any of those, but they look interesting..
Take a look at Gearman as well.. more overhead in systems like these but you get other cool stuff :) Guess it depends on your needs ..
The location of the
$_SESSION
variable storage is determined by PHP'ssession.save_path
configuration. Usually this is/tmp
on a Linux/Unix system. Use thephpinfo()
function to view your particular settings if not 100% sure by creating a file with this content in theDocumentRoot
of your domain:Here is the link to the PHP documentation on this configuration setting:
http://php.net/manual/en/session.configuration.php#ini.session.save-path