Maison  >  Article  >  développement back-end  >  请教内存共享的问题!

请教内存共享的问题!

WBOY
WBOYoriginal
2016-06-23 13:49:09907parcourir


代码如下:

<?php$sysid = $shmkey = ftok(__FILE__, 't');$flags = "c";$mode = 0766;$size = 1024;$shmid = shmop_open($sysid, $flags, $mode, $size);shmop_write($shmid, "Hello", 0);$len = shmop_size($shmid);$cont = shmop_read($sysid, 0, "Hello");var_dump($cont);shmop_delete($shmid);shmop_close($shmid);?> 

这段代码报错,请问是怎么回事?
PHP Warning:  shmop_read(): no shared memory segment with an id of [1946257823] in /home/admin/codes/php/shmop/client.php on line 8Warning: shmop_read(): no shared memory segment with an id of [1946257823] in /home/admin/codes/php/shmop/client.php on line 8



回复讨论(解决方案)

$cont = shmop_read($shmid, 0, "Hello");

$cont = shmop_read($shmid, 0, "Hello");



艾玛,又犯低级错误,非常感谢!
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn