最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

请问内存共享的有关问题!

来源:http://erdangjiade.com/topic/79630.html 你好,世界。 2017-10-04 21:03浏览(0)

请教内存共享的问题!!!

代码如下:

<?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 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");

评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2