请问内存共享的有关问题!
程序员文章站
2024-02-04 23:01:10
...
请教内存共享的问题!!!
代码如下:
这段代码报错,请问是怎么回事?
------解决思路----------------------
$cont = shmop_read($shmid, 0, "Hello");
代码如下:
$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 8
Warning: 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");
相关文章
相关视频
上一篇: wdcp环境下更新PHP到53教程