给PHP开启shmop扩展实现共享内存详解编程语言
2023-06-13 09:11:47 时间
在项目开发中,想要实现PHP多个进程之间共享数据的功能,让客户端连接能够共享一个状态,需要开启共享内存函数shmop。如果预期考虑会遇到这方面需求,那么最好在编译PHP的时候添加 with-shmop选项。但是编译的时候没有添加,只能在重新编译配置了。
一、找到php源码包里的扩展目录,进入shmop
# cd /usr/local/src/php-7.1.10/ext/shmop/
二、执行phpize,生成配置
# phpize
[[email protected] shmop]# ls acinclude.m4 build config.h.in config.nice configure CREDITS libtool Makefile.fragments missing package2.xml README shmop.la aclocal.m4 config.guess config.log config.status configure.in include ltmain.sh Makefile.global mkinstalldirs package.xml run-tests.php shmop.lo autom4te.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 install
See any operating system documentation about shared libraries for more 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
;extension=php_pgsql.dll extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/shmop.so //添加此行代码,后面跟上shmop.so
重启php
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/17179.html
cjavaphpxml相关文章
- Fatal error: require(): Failed opening required ‘/www/wwwroot/xxxxxx/public/../thinkphp/start.php
- 展现魅力:PHP支持MySQL扩展(php支持mysql扩展)
- 服务?探索Linux如何启动PHP服务(linux是否启动php)
- PHP多进程并行执行php脚本详解编程语言
- 部署PHP应用:Linux服务器上的挑战(linux部署php)
- Linux系统下PHP安装Redis扩展的步骤(php安装redis)
- Linux下部署PHP网站的指南(linux部署php网站)
- PHP从Linux中读取文件的方法(php读取linux文件)
- 使用PHP操作MySQL数据库的基础——mysql类库(mysql类库php)
- PHP操作MySQL精通实战(php 操作 mysql)
- 轻松完成PHP连接MSSQL环境的配置(php连接mssql配置)
- 在PHP中安装MySQL扩展:一步一步操作指引(php安装mysql扩展)
- 安装PHP扩展程序让网站支持Redis(安装php-redis)
- PHP的面向对象编程
- php入门学习知识点二PHP简单的分页过程与原理
- PHP中file_exists与is_file,is_dir的区别介绍
- php教程插件机制在PHP中实现方案