It appears that you must be connected to the shm segment in order to remove it.
produces "Warning: shm_remove(): The parameter is not a valid shm_identifier ..."
(PHP 4, PHP 5)
shm_remove — Removes shared memory from Unix systems
shm_remove() removes the shared memory
shm_identifier. All data will be destroyed.
The shared memory identifier as returned by shm_attach()
TRUE în cazul
FALSE în cazul eșecului.
Vedeți de asemenea
- shm_remove_var() - Removes a variable from shared memory
Though it says **shm_identifier** in
int shm_remove(int shm_identifier);
shm_attach() returns an **id** that that can be used to access the System V...
a snippet like this:
$key = 1234;
// do whatever...
produces an error like
Warning: 2(which is the value of $shm) is not a existing SysV shared memory key in /usr/cu/web/sema.php on line 44...
The documentation confused me a bit. I thought shm_remove would get the shm handle/id that returns from shm_attach, not the key given to shm_attach. So, use instead:
which is what is intended indeed.