This article mainly introduces about the shmop extension to PHP to achieve shared memory, has a certain reference value, now share to everyone, the need for friends can refer to
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.10/ext/shmop/
Second, execute phpize, generate configuration
# phpize
[Root@bogon 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
Third, execute the command to start compiling
#./configure--with-php-config=/usr/local/php/bin/php-config# make && make install
See all operating system documentation about shared libraries Formore information, such as the LD (1) and ld.so (8) Manual P Ages.----------------------------------------------------------------------Build complete. Don ' t forget to run ' 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 code, followed by shmop.so
Restart PHP
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!