In project development, the ability to share data between multiple processes in PHP is enabled so that the client connection can share a state and the shared memory function Shmop needs to be turned on. If you anticipate this need, it's a good idea to add the--WITH-SHMOP option when compiling PHP. But the compile time is not added, only in the recompile configuration.
First, find the PHP source package extension directory, into the SHMOP
# cd/usr/local/src/php-7.1. Ten/ext/shmop/
Second, execute phpize, generate configuration
# phpize
[email protected] shmop]# lsacinclude.m4 build config.h. inch config.nice Configure CREDITS libtool makefile.fragments missing Package2.xml README shmop.laaclocal.m4 config.guess config.log config.status Configure. inch 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
Third, execute the command to start compiling
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 ' make Test ' installing shared extensions: /usr/local/php/lib/php/extensions/ No-debug-non-zts-20160303 /
Iv. Modify the php.ini to open the extension
The path returned by the copy:/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.dllextension=/usr/local/php/lib/php/ extensions/no-debug-non-zts-20160303/shmop.so // Add this line of code, followed by shmop.so
Restart PHP
Open Shmop Extension to PHP for shared memory