周伟红,陪游龙将,反邪教诗歌
需要安装扩展shmop
找到php安装源文件目录
# cd /usr/local/php-5.4.0/ext/shmop
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make && make install
编译安装成功
# cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
多出一个 shmop.so
在php.ini增加shmop.so
extension=shmop.so
; module settings ;
phpinfo()输出
写数据
<?php
$shmid = shmop_open(864, 'c', 0755, 1024);
shmop_write($shmid, "hello world!", 0);
phpinfo();
?>
读数据
<?php
$shmid = shmop_open(864, 'c', 0755, 1024);
shmop_write($shmid, "hello world!", 0);
echo shmop_read($shmid, 0, 11);
?>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
网友评论