Home > Backend Development > PHP Tutorial > 请教内存共享的问题!

请教内存共享的问题!

WBOY
Release: 2016-06-23 13:49:09
Original
974 people have browsed it


代码如下:

<?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);?> 
Copy after login

这段代码报错,请问是怎么回事?
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
Copy after login



回复讨论(解决方案)

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

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



艾玛,又犯低级错误,非常感谢!
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template