Yum安装的PHP需安装扩展包php-process:
1 2 3 4 5 6 7 8 9 10 11 | <?php $shm_key = intval (bin2hex( 'node' ), '16' ); $memsize = 120; $shm_h = shm_attach( $shm_key , $memsize , 0644); $var_key = intval (bin2hex( 'key' ), '16' ); $var_value = 'hello' ; shm_put_var( $shm_h , $var_key , $var_value ); echo shm_get_var( $shm_h , $var_key ); shm_remove_var( $shm_h , $var_key ); shm_detach( $shm_h ); ?> |
标签:none