一、找到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. 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 擴充套件實現共用記憶體的詳細內容,更多請關注TW511.COM其它相關文章!