
{"id":3296,"date":"2019-11-08T16:12:45","date_gmt":"2019-11-08T08:12:45","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=3296"},"modified":"2019-11-08T16:12:45","modified_gmt":"2019-11-08T08:12:45","slug":"php-redis-extension","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=3296","title":{"rendered":"[ Linux ] &#8211; PHP \u5b89\u88dd Redis \u64f4\u5c55"},"content":{"rendered":"<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div><div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div>\n<p>\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002<\/p>\n\n\n<p>\u5148\u67e5\u8a62 redis \u7248\u672c<br \/>\n\u6307\u4ee4\uff1asudo redis-cli -v<br \/>\nredis-cli 4.0.9<\/p>\n\n\n<p>\u5230\u5b98\u7db2\u4e0b\u8f09\u76f8\u5c0d\u61c9\u7684\u64f4\u5c55\u5957\u4ef6<br \/> http:\/\/pecl.php.net\/package\/redis<br \/>\u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>wget http:\/\/pecl.php.net\/get\/redis-4.0.2.tgz<\/code><\/pre>\n\n\n<p><br \/> &#8211;2019-11-08 15:29:27&#8211;  http:\/\/pecl.php.net\/get\/redis-4.0.2.tgz<br \/> Resolving pecl.php.net (pecl.php.net)\u2026 104.236.228.160<br \/> Connecting to pecl.php.net (pecl.php.net)|104.236.228.160|:80\u2026 connected.<br \/> HTTP request sent, awaiting response\u2026 200 OK<br \/> Length: 212617 (208K) [application\/octet-stream]<br \/> Saving to: \u2018redis-4.0.2.tgz\u2019<\/p>\n\n\n<p>redis-4.0.2.tgz                                    100%[================================================================================================================&gt;] 207.63K   256KB\/s    in 0.8s    <\/p>\n\n\n<p>2019-11-08 15:29:28 (256 KB\/s) &#8211; \u2018redis-4.0.2.tgz\u2019 saved [212617\/212617]<br \/>\u89e3\u58d3\u7e2e\u8a72\u6a94\u6848<br \/>\u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>tar -zxvf redis-4.0.2.tgz<\/code><\/pre>\n\n\n<p> package.xml<br \/> redis-4.0.2\/liblzf\/LICENSE redis-4.0.2\/liblzf\/README<br \/> redis-4.0.2\/liblzf\/lzf.h<br \/> redis-4.0.2\/liblzf\/lzfP.h<br \/> redis-4.0.2\/liblzf\/lzf_c.c<br \/> redis-4.0.2\/liblzf\/lzf_d.c<br \/> redis-4.0.2\/tests\/RedisArrayTest.php<br \/> redis-4.0.2\/tests\/RedisClusterTest.php<br \/> redis-4.0.2\/tests\/RedisTest.php<br \/> redis-4.0.2\/tests\/TestRedis.php<br \/> redis-4.0.2\/tests\/TestSuite.php<br \/> redis-4.0.2\/tests\/make-cluster.sh<br \/> redis-4.0.2\/tests\/mkring.sh<br \/> redis-4.0.2\/COPYING<br \/> redis-4.0.2\/CREDITS<br \/> redis-4.0.2\/README.markdown<br \/> redis-4.0.2\/arrays.markdown<br \/> redis-4.0.2\/cluster.markdown<br \/> redis-4.0.2\/cluster_library.c<br \/> redis-4.0.2\/cluster_library.h<br \/> redis-4.0.2\/common.h<br \/> redis-4.0.2\/config.m4<br \/> redis-4.0.2\/config.w32<br \/> redis-4.0.2\/crc16.h<br \/> redis-4.0.2\/library.c<br \/> redis-4.0.2\/library.h<br \/> redis-4.0.2\/php_redis.h<br \/> redis-4.0.2\/redis.c<br \/> redis-4.0.2\/redis_array.c<br \/> redis-4.0.2\/redis_array.h<br \/> redis-4.0.2\/redis_array_impl.c<br \/> redis-4.0.2\/redis_array_impl.h<br \/> redis-4.0.2\/redis_cluster.c<br \/> redis-4.0.2\/redis_cluster.h<br \/> redis-4.0.2\/redis_commands.c<br \/> redis-4.0.2\/redis_commands.h<br \/> redis-4.0.2\/redis_session.c<br \/> redis-4.0.2\/redis_session.h<\/p>\n\n\n<p>\u5207\u63db\u5230 redis \u8cc7\u6599\u593e\u4e2d<br \/> \u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>cd redis-4.0.2<\/code><\/pre>\n\n\n<p>\u5b89\u88ddphp\u64f4\u5c55<br \/> \u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>sudo phpize<\/code><\/pre>\n\n\n<p>\u51fa\u73fe\u932f\u8aa4 sudo: phpize: command not found<br \/> \u7cfb\u7d71\u9084\u6c92\u5b89\u88dd phpize \uff08phpize \u529f\u80fd\u662f\u53ef\u4ee5\u8b93\u4f60\u7de8\u8b6f\u67d0\u4e9bphp\u64f4\u5c55\uff0c\u800c\u4e0d\u7528\u91cd\u65b0\u7de8\u8b6f\u6574\u500bphp\uff09<br \/>phpize\u5b89\u88dd\u6307\u4ee4\uff1a \uff08\u9700\u5c0d\u61c9\u4f60\u7684php\u7248\u672c\uff09<\/p>\n\n\n<pre class=\"wp-block-code\"><code>apt install php7.2-dev<\/code><\/pre>\n\n\n<p>Reading package lists\u2026 Done<br \/> Building dependency tree       <br \/> Reading state information\u2026 Done<br \/> The following additional packages will be installed:<br \/>   autoconf automake autopoint autotools-dev build-essential debhelper dh-autoreconf dh-strip-nondeterminism dpkg-dev fakeroot g++ g++-7 gcc gcc-7 libalgorithm-diff-perl libalgorithm-diff-xs-perl<br \/>   libalgorithm-merge-perl libarchive-cpio-perl libasan4 libatomic1 libc-dev-bin libc6-dev libcilkrts5 libfakeroot libfile-stripnondeterminism-perl libgcc-7-dev libitm1 liblsan0 libltdl-dev<br \/>   libmail-sendmail-perl libmpx2 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libquadmath0 libsigsegv2 libssl-dev libstdc++-7-dev libsys-hostname-long-perl libtool libtsan0 libubsan0 linux-libc-dev<br \/>   m4 make manpages-dev pkg-php-tools po-debconf shtool<br \/> Suggested packages:<br \/>   autoconf-archive gnu-standards autoconf-doc dh-make dwz debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib flex bison gcc-doc gcc-7-multilib gcc-7-locales libgcc1-dbg<br \/>   libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg glibc-doc libtool-doc libssl-doc libstdc++-7-doc gfortran<br \/>   | fortran95-compiler gcj-jdk m4-doc make-doc dh-php libmail-box-perl<br \/> The following NEW packages will be installed:<br \/>   autoconf automake autopoint autotools-dev build-essential debhelper dh-autoreconf dh-strip-nondeterminism dpkg-dev fakeroot g++ g++-7 gcc gcc-7 libalgorithm-diff-perl libalgorithm-diff-xs-perl<br \/>   libalgorithm-merge-perl libarchive-cpio-perl libasan4 libatomic1 libc-dev-bin libc6-dev libcilkrts5 libfakeroot libfile-stripnondeterminism-perl libgcc-7-dev libitm1 liblsan0 libltdl-dev<br \/>   libmail-sendmail-perl libmpx2 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libquadmath0 libsigsegv2 libssl-dev libstdc++-7-dev libsys-hostname-long-perl libtool libtsan0 libubsan0 linux-libc-dev<br \/>   m4 make manpages-dev php7.2-dev pkg-php-tools po-debconf shtool<br \/> 0 upgraded, 51 newly installed, 0 to remove and 22 not upgraded.<br \/> Need to get 33.1 MB of archives.<br \/> After this operation, 144 MB of additional disk space will be used.<br \/> Do you want to continue? [Y\/n] y<br \/> Get:1 http:\/\/us.archive.ubuntu.com\/ubuntu bionic\/main amd64 libsigsegv2 amd64 2.12-1 [14.7 kB]<br \/> Get:2 http:\/\/us.archive.ubuntu.com\/ubuntu bionic\/main amd64 m4 amd64 1.4.18-1 [197 kB]<br \/> Get:3 http:\/\/us.archive.ubuntu.com\/ubuntu bionic\/main amd64 autoconf all 2.69-11 [322 kB]<br \/> Get:4 http:\/\/us.archive.ubuntu.com\/ubuntu bionic\/main amd64 autotools-dev all 20180224.1 [39.6 kB]<br \/> Get:5 http:\/\/us.archive.ubuntu.com\/ubuntu bionic\/main amd64 automake all 1:1.15.1-3ubuntu2 [509 kB]<br \/> Get:6 http:\/\/us.archive.ubuntu.com\/ubuntu bionic-updates\/main amd64 autopoint all 0.19.8.1-6ubuntu0.3 [426 kB]  <br \/> \u4ee5\u4e0b\u7565\u2026<br \/><br \/>\u91cd\u65b0\u5b89\u88dd\u64f4\u5c55<br \/>\u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>sudo phpize<\/code><\/pre>\n\n\n<p>Configuring for:<br \/> PHP Api Version:         20170718<br \/><br \/> Zend Module Api No:      20170718<br \/> Zend Extension Api No:   320170718<br \/><br \/>\u914d\u7f6e\u53c3\u6578<br \/>\u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>.\/configure --with-php-config=\/usr\/bin\/php-config<\/code><\/pre>\n\n\n<p>checking for grep that handles long lines and -e\u2026 \/bin\/grep<br \/> checking for egrep\u2026 \/bin\/grep -E<br \/> checking for a sed that does not truncate output\u2026 \/bin\/sed<br \/> checking for cc\u2026 cc<br \/> checking whether the C compiler works\u2026 yes<br \/> checking for C compiler default output file name\u2026 a.out<br \/> checking for suffix of executables\u2026 <br \/> checking whether we are cross compiling\u2026 no<br \/> checking for suffix of object files\u2026 o<br \/> checking whether we are using the GNU C compiler\u2026 yes<br \/> checking whether cc accepts -g\u2026 yes<br \/> checking for cc option to accept ISO C89\u2026 none needed<br \/> checking how to run the C preprocessor\u2026 cc -E<br \/> checking for icc\u2026 no<br \/> checking for suncc\u2026 no<br \/> checking whether cc understands -c and -o together\u2026 yes<br \/> checking for system library directory\u2026 lib<br \/> checking if compiler supports -R\u2026 no<br \/> checking if compiler supports -Wl,-rpath,\u2026 yes<br \/> checking build system type\u2026 x86_64-pc-linux-gnu<br \/> checking host system type\u2026 x86_64-pc-linux-gnu<br \/> checking target system type\u2026 x86_64-pc-linux-gnu<br \/> checking for PHP prefix\u2026 \/usr<br \/> checking for PHP includes\u2026 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib<br \/> checking for PHP extension directory\u2026 \/usr\/lib\/php\/20170718<br \/> checking for PHP installed headers prefix\u2026 \/usr\/include\/php\/20170718<br \/> checking if debug is enabled\u2026 no<br \/> checking if zts is enabled\u2026 no<br \/> checking for re2c\u2026 no<br \/> configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.<br \/> checking for gawk\u2026 no<br \/> checking for nawk\u2026 nawk<br \/> checking if nawk is broken\u2026 no<br \/> checking whether to enable redis support\u2026 yes, shared<br \/> checking whether to enable sessions\u2026 yes<br \/> checking whether to enable igbinary serializer support\u2026 no<br \/> checking whether to enable lzf compression\u2026 no<br \/> checking use system liblzf\u2026 no<br \/> checking for redis igbinary support\u2026 disabled<br \/> checking how to print strings\u2026 printf<br \/> checking for a sed that does not truncate output\u2026 (cached) \/bin\/sed<br \/> checking for fgrep\u2026 \/bin\/grep -F<br \/> checking for ld used by cc\u2026 \/usr\/bin\/ld<br \/> checking if the linker (\/usr\/bin\/ld) is GNU ld\u2026 yes<br \/> checking for BSD- or MS-compatible name lister (nm)\u2026 \/usr\/bin\/nm -B<br \/> checking the name lister (\/usr\/bin\/nm -B) interface\u2026 BSD nm<br \/> checking whether ln -s works\u2026 yes<br \/> checking the maximum length of command line arguments\u2026 1572864<br \/> checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format\u2026 func_convert_file_noop<br \/> checking how to convert x86_64-pc-linux-gnu file names to toolchain format\u2026 func_convert_file_noop<br \/> checking for \/usr\/bin\/ld option to reload object files\u2026 -r<br \/> checking for objdump\u2026 objdump<br \/> checking how to recognize dependent libraries\u2026 pass_all<br \/> checking for dlltool\u2026 no<br \/> checking how to associate runtime and link libraries\u2026 printf %s\\n<br \/> checking for ar\u2026 ar<br \/> checking for archiver @FILE support\u2026 @<br \/> checking for strip\u2026 strip<br \/> checking for ranlib\u2026 ranlib<br \/> checking for gawk\u2026 (cached) nawk<br \/> checking command to parse \/usr\/bin\/nm -B output from cc object\u2026 ok<br \/> checking for sysroot\u2026 no<br \/> checking for a working dd\u2026 \/bin\/dd<br \/> checking how to truncate binary pipes\u2026 \/bin\/dd bs=4096 count=1<br \/> checking for mt\u2026 mt<br \/> checking if mt is a manifest tool\u2026 no<br \/> checking for ANSI C header files\u2026 yes<br \/> checking for sys\/types.h\u2026 yes<br \/> checking for sys\/stat.h\u2026 yes<br \/> checking for stdlib.h\u2026 yes<br \/> checking for string.h\u2026 yes<br \/> checking for memory.h\u2026 yes<br \/> checking for strings.h\u2026 yes<br \/> checking for inttypes.h\u2026 yes<br \/> checking for stdint.h\u2026 yes<br \/> checking for unistd.h\u2026 yes<br \/> checking for dlfcn.h\u2026 yes<br \/> checking for objdir\u2026 .libs<br \/> checking if cc supports -fno-rtti -fno-exceptions\u2026 no<br \/> checking for cc option to produce PIC\u2026 -fPIC -DPIC<br \/> checking if cc PIC flag -fPIC -DPIC works\u2026 yes<br \/> checking if cc static flag -static works\u2026 yes<br \/> checking if cc supports -c -o file.o\u2026 yes<br \/> checking if cc supports -c -o file.o\u2026 (cached) yes<br \/> checking whether the cc linker (\/usr\/bin\/ld -m elf_x86_64) supports shared libraries\u2026 yes<br \/> checking whether -lc should be explicitly linked in\u2026 no<br \/> checking dynamic linker characteristics\u2026 GNU\/Linux ld.so<br \/> checking how to hardcode library paths into programs\u2026 immediate<br \/> checking whether stripping libraries is possible\u2026 yes<br \/> checking if libtool supports shared libraries\u2026 yes<br \/> checking whether to build shared libraries\u2026 yes<br \/> checking whether to build static libraries\u2026 no<br \/> configure: creating .\/config.status<br \/> config.status: creating config.h<br \/> config.status: executing libtool commands<br \/><br \/>\u7de8\u8b6f<br \/>\u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>make<\/code><\/pre>\n\n\n<p> \/bin\/bash \/home\/u1804\/Desktop\/redis-4.0.2\/libtool &#8211;mode=compile cc  -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib  -DHAVE_CONFIG_H  -g -O2   -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis.c -o redis.lo <br \/> libtool: compile:  cc -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib -DHAVE_CONFIG_H -g -O2 -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis.c  -fPIC -DPIC -o .libs\/redis.o<br \/> \/bin\/bash \/home\/u1804\/Desktop\/redis-4.0.2\/libtool &#8211;mode=compile cc  -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib  -DHAVE_CONFIG_H  -g -O2   -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis_commands.c -o redis_commands.lo <br \/> libtool: compile:  cc -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib -DHAVE_CONFIG_H -g -O2 -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis_commands.c  -fPIC -DPIC -o .libs\/redis_commands.o<br \/> \/bin\/bash \/home\/u1804\/Desktop\/redis-4.0.2\/libtool &#8211;mode=compile cc  -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib  -DHAVE_CONFIG_H  -g -O2   -c \/home\/u1804\/Desktop\/redis-4.0.2\/library.c -o library.lo <br \/> libtool: compile:  cc -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib -DHAVE_CONFIG_H -g -O2 -c \/home\/u1804\/Desktop\/redis-4.0.2\/library.c  -fPIC -DPIC -o .libs\/library.o<br \/> \/bin\/bash \/home\/u1804\/Desktop\/redis-4.0.2\/libtool &#8211;mode=compile cc  -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib  -DHAVE_CONFIG_H  -g -O2   -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis_session.c -o redis_session.lo <br \/> libtool: compile:  cc -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib -DHAVE_CONFIG_H -g -O2 -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis_session.c  -fPIC -DPIC -o .libs\/redis_session.o<br \/> \/bin\/bash \/home\/u1804\/Desktop\/redis-4.0.2\/libtool &#8211;mode=compile cc  -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib  -DHAVE_CONFIG_H  -g -O2   -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis_array.c -o redis_array.lo <br \/> libtool: compile:  cc -I. -I\/home\/u1804\/Desktop\/redis-4.0.2 -DPHP_ATOM_INC -I\/home\/u1804\/Desktop\/redis-4.0.2\/include -I\/home\/u1804\/Desktop\/redis-4.0.2\/main -I\/home\/u1804\/Desktop\/redis-4.0.2 -I\/usr\/include\/php\/20170718 -I\/usr\/include\/php\/20170718\/main -I\/usr\/include\/php\/20170718\/TSRM -I\/usr\/include\/php\/20170718\/Zend -I\/usr\/include\/php\/20170718\/ext -I\/usr\/include\/php\/20170718\/ext\/date\/lib -DHAVE_CONFIG_H -g -O2 -c \/home\/u1804\/Desktop\/redis-4.0.2\/redis_array.c  -fPIC -DPIC -o .libs\/redis_array.o<br \/> \u4ee5\u4e0b\u7565\u2026<br \/><br \/>\u5b89\u88dd<br \/>\u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>sudo make install <\/code><\/pre>\n\n\n<p>Installing shared extensions:     \/usr\/lib\/php\/20170718\/<br \/>\u7de8\u8f2f php.ini<br \/>\u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/php\/7.2\/apache2\/php.ini<\/code><\/pre>\n\n\n<p><br \/> \u518d\u6a94\u6848\u6700\u4e0b\u65b9\u8f38\u5165<br \/> extension=redis.so<\/p>\n\n\n<p>\u91cd\u555fapache<br \/> \u6307\u4ee4\uff1a<\/p>\n\n\n<pre class=\"wp-block-code\"><code>sudo service apache2 restart<\/code><\/pre>\n\n\n<p>\u518d\u900f\u904e phpinfo()\u67e5\u770b\u662f\u5426\u5df2\u5b89\u88dd\u597d redis\u7684\u64f4\u5c55<br \/>\nredis<br \/>\nRedis Support    enabled<br \/>\nRedis Version     4.0.2<br \/>\nAvailable serializers     php <\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>\t\t\t\t\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002<\/p>\n","protected":false},"author":1,"featured_media":3618,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"categories":[32],"tags":[370,448,483,484],"class_list":["post-3296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux","tag-php","tag-redis","tag-redis-extension"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[ Linux ] - PHP \u5b89\u88dd Redis \u64f4\u5c55 - \u6df7\u6c34\u6478\u9b5a<\/title>\n<meta name=\"description\" content=\"\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webteach.tw\/?p=3296\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[ Linux ] - PHP \u5b89\u88dd Redis \u64f4\u5c55 - \u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"og:description\" content=\"\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webteach.tw\/?p=3296\" \/>\n<meta property=\"og:site_name\" content=\"\u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-08T08:12:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"jeff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"jeff\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296\"},\"author\":{\"name\":\"jeff\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"headline\":\"[ Linux ] &#8211; PHP \u5b89\u88dd Redis \u64f4\u5c55\",\"datePublished\":\"2019-11-08T08:12:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296\"},\"wordCount\":2123,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"keywords\":[\"linux\",\"php\",\"Redis\",\"Redis extension\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296\",\"name\":\"[ Linux ] - PHP \u5b89\u88dd Redis \u64f4\u5c55 - \u6df7\u6c34\u6478\u9b5a\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"datePublished\":\"2019-11-08T08:12:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"description\":\"\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=3296\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#primaryimage\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webteach.tw\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg\",\"width\":1600,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=3296#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\\\/\\\/www.webteach.tw\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[ Linux ] &#8211; PHP \u5b89\u88dd Redis \u64f4\u5c55\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/\",\"name\":\"\u6df7\u6c34\u6478\u9b5a\",\"description\":\"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webteach.tw\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\",\"name\":\"jeff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"caption\":\"jeff\"},\"sameAs\":[\"http:\\\/\\\/35.72.55.111\"],\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?author=1\"},false]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[ Linux ] - PHP \u5b89\u88dd Redis \u64f4\u5c55 - \u6df7\u6c34\u6478\u9b5a","description":"\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webteach.tw\/?p=3296","og_locale":"zh_TW","og_type":"article","og_title":"[ Linux ] - PHP \u5b89\u88dd Redis \u64f4\u5c55 - \u6df7\u6c34\u6478\u9b5a","og_description":"\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002","og_url":"https:\/\/www.webteach.tw\/?p=3296","og_site_name":"\u6df7\u6c34\u6478\u9b5a","article_published_time":"2019-11-08T08:12:45+00:00","og_image":[{"width":1600,"height":1200,"url":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","type":"image\/jpeg"}],"author":"jeff","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005:":"jeff","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"11 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webteach.tw\/?p=3296#article","isPartOf":{"@id":"https:\/\/www.webteach.tw\/?p=3296"},"author":{"name":"jeff","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"headline":"[ Linux ] &#8211; PHP \u5b89\u88dd Redis \u64f4\u5c55","datePublished":"2019-11-08T08:12:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webteach.tw\/?p=3296"},"wordCount":2123,"commentCount":0,"image":{"@id":"https:\/\/www.webteach.tw\/?p=3296#primaryimage"},"thumbnailUrl":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","keywords":["linux","php","Redis","Redis extension"],"articleSection":["Linux"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webteach.tw\/?p=3296#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webteach.tw\/?p=3296","url":"https:\/\/www.webteach.tw\/?p=3296","name":"[ Linux ] - PHP \u5b89\u88dd Redis \u64f4\u5c55 - \u6df7\u6c34\u6478\u9b5a","isPartOf":{"@id":"https:\/\/www.webteach.tw\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webteach.tw\/?p=3296#primaryimage"},"image":{"@id":"https:\/\/www.webteach.tw\/?p=3296#primaryimage"},"thumbnailUrl":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","datePublished":"2019-11-08T08:12:45+00:00","author":{"@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"description":"\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5df2\u7d93\u70ba\u7cfb\u7d71\u5b89\u88dd\u597d Redis , \u56e0\u70ba\u4e4b\u5f8c\u662f\u8981\u900f\u904ephp\u4f86\u64cd\u4f5c Redis \u6240\u4ee5\u8981\u70baphp\u5b89\u88dd Redis \u64f4\u5c55\u3002","breadcrumb":{"@id":"https:\/\/www.webteach.tw\/?p=3296#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webteach.tw\/?p=3296"]}]},{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/www.webteach.tw\/?p=3296#primaryimage","url":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","contentUrl":"https:\/\/www.webteach.tw\/wp-content\/uploads\/2020\/05\/sai-kiran-anagani-Tjbk79TARiE-unsplash-scaled-1.jpg","width":1600,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/www.webteach.tw\/?p=3296#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/www.webteach.tw\/"},{"@type":"ListItem","position":2,"name":"[ Linux ] &#8211; PHP \u5b89\u88dd Redis \u64f4\u5c55"}]},{"@type":"WebSite","@id":"https:\/\/www.webteach.tw\/#website","url":"https:\/\/www.webteach.tw\/","name":"\u6df7\u6c34\u6478\u9b5a","description":"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webteach.tw\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":"Person","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520","name":"jeff","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","caption":"jeff"},"sameAs":["http:\/\/35.72.55.111"],"url":"https:\/\/www.webteach.tw\/?author=1"},false]}},"views":1313,"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/3296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3296"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/3296\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/media\/3618"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}