|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-02-16 03:42 UTC] yury at gorodok dot net
Description: ------------ shmop doesn't work properly. I start sh.php, which creates shmop segment and write a strring there. After that I start hh.php, which should read string and write it in my browser. The hs.php deletes segment. On FreeBSD with PHP 4.3.4(apache module and command line) this works just fine. But on Win2000SP2 with PHP5.0.0b4(commandline and cgi) I can access shared memory segment only while the first script is running (I' ve adde sleep(30) in it for test reasons). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 22:00:01 2025 UTC |
sh.php <?php $shm_key= 111; $str="I was here."; $shm_id= shmop_open($shm_key, "c", 0644, strlen($str)); if ($shm_id== false) echo "I was unable to create shmop!<BR>"; else { $wrb=shmop_write($shm_id,$str, 0); if($wrb!= strlen($str)) echo $wrb." bytes was written of ".strlen($str)."!<BR>"; echo "shm_id=".$shm_id."<BR>"; shmop_close($shm_id);} ?> hh.php <?php $shm_key= 111; $shm_id=@shmop_open($shm_key, "a", 0, 0); if ($shm_id== false) echo "Couln'd open shm <".$shm_key.">!<BR>"; else {$A=shmop_read($shm_id, 0, shmop_size($shm_id)); echo $A."<BR>"; echo "shm_id=".$shm_id; shmop_close($shm_id); } ?> hs.php <?php $shm_key= 111; $shm_id=@shmop_open($shm_key, "a", 0, 0); if ($shm_id== false) echo "Couln'd open shm <".$shm_key.">!<BR>"; else {$A=shmop_read($shm_id, 0, shmop_size($shm_id)); echo $A."<BR>"; echo "shm_id=".$shm_id; shmop_delete($shm_id); shmop_close($shm_id); } ?>