时间:2021-07-01 10:21:17 帮助过:22人阅读
一、找到php源码包里的扩展目录,进入shmop
# cd /usr/local/src/php-7.1.10/ext/shmop/
二、执行phpize,生成配置
# phpize [root@bogon 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. Don't 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_pdo_sqlite.dll ;extension=php_pgsql.dll extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/shmop.so //添加此行代码,后面跟上shmop.so
重启php
以上就是给 PHP 开启 shmop 扩展实现共享内存的详细内容,更多请关注Gxl网其它相关文章!