Open Shmop Extension to PHP for shared memory

Source: Internet
Author: User
Tags zts

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.