中建一局华江建设有限公司网站,青县有做网站的吗,可以做雷达图的网站,电子商务营销案例分析这篇文章主要介绍了关于给PHP开启shmop扩展实现共享内存#xff0c;有着一定的参考价值#xff0c;现在分享给大家#xff0c;有需要的朋友可以参考一下在项目开发中#xff0c;想要实现PHP多个进程之间共享数据的功能#xff0c;让客户端连接能够共享一个状态#xff0c…这篇文章主要介绍了关于给PHP开启shmop扩展实现共享内存有着一定的参考价值现在分享给大家有需要的朋友可以参考一下在项目开发中想要实现PHP多个进程之间共享数据的功能让客户端连接能够共享一个状态需要开启共享内存函数shmop。如果预期考虑会遇到这方面需求那么最好在编译PHP的时候添加--with-shmop选项。但是编译的时候没有添加只能在重新编译配置了。一、找到php源码包里的扩展目录进入shmop# cd /usr/local/src/php-7.1.10/ext/shmop/二、执行phpize生成配置# phpize[rootbogon shmop]# lsacinclude.m4 build config.h.in config.nice configure CREDITS libtool Makefile.fragments missing package2.xml README shmop.laaclocal.m4 config.guess config.log config.status configure.in include ltmain.sh Makefile.global mkinstalldirs package.xml run-tests.php shmop.loautom4te.cache config.h config.m4 config.sub config.w32 install-sh Makefile Makefile.objects modules php_shmop.h shmop.c tests三、执行命令开始编译# ./configure --with-php-config/usr/local/php/bin/php-config# make make installSee any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------Build complete.Dont forget to run make test.Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/四、修改php.ini开启扩展复制返回的那行路径/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/# vim /usr/local/php/etc/php.ini;extensionphp_pdo_sqlite.dll;extensionphp_pgsql.dllextension/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/shmop.so //添加此行代码后面跟上shmop.so重启php以上就是本文的全部内容希望对大家的学习有所帮助更多相关内容请关注PHP中文网相关推荐