How to install php apcu extention from source centos 7
Download the apcu extention
[root@ipo ~]# wget https://pecl.php.net/get/apcu-4.0.11.tgz
--2019-08-17 16:17:52-- https://pecl.php.net/get/apcu-4.0.11.tgz
Resolving pecl.php.net (pecl.php.net)... 104.236.228.160
Connecting to pecl.php.net (pecl.php.net)|104.236.228.160|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 119535 (117K) [application/octet-stream]
Saving to: ‘apcu-4.0.11.tgz’
100%[===================================>] 119,535 149KB/s in 0.8s
2019-08-17 16:17:54 (149 KB/s) - ‘apcu-4.0.11.tgz’ saved [119535/119535]
[root@ipo ~]#
[root@ipo ~]# ls
anaconda-ks.cfg apcu-4.0.11.tgz php-5.6.37 php-5.6.37.tar.gz
[root@ipo ~]#
[root@ipo ~]# tar -xzf apcu-4.0.11.tgz
[root@ipo ~]#
[root@ipo ~]# ls
anaconda-ks.cfg apcu-4.0.11.tgz php-5.6.37
apcu-4.0.11 package.xml php-5.6.37.tar.gz
[root@ipo ~]#
Change working directory to apcu
[root@ipo ~]# cd apcu-4.0.11
[root@ipo apcu-4.0.11]# ls
apc_api.h apc.php apc_windows_srwlock_kernel.c
apc_bin_api.h apc_php.h apc_windows_srwlock_kernel.h
apc_bin.c apc_php_pcre.h config.m4
apc_bin.h apc_pool_api.h config.w32
apc.c apc_pool.c INSTALL
apc_cache_api.h apc_pool.h LICENSE
apc_cache.c apc_rfc1867.c Makefile.frag
apc_cache.h apc_serializer.h NOTICE
apc_globals.h apc_shm.c pgsql_s_lock.c
apc.h apc_shm.h pgsql_s_lock.h
apc_iterator.c apc_signal.c php_apc.c
apc_iterator.h apc_signal.h php_apc.h
apc_lock_api.h apc_sma_api.h README.md
apc_lock.c apc_sma.c TECHNOTES.txt
apc_lock.h apc_sma.h tests
apc_mmap.c apc_stack.c TODO
apc_mmap.h apc_stack.h
[root@ipo apcu-4.0.11]#
Run phpize command
[root@ipo apcu-4.0.11]# phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
[root@ipo apcu-4.0.11]#
[root@ipo apcu-4.0.11]# ls
acinclude.m4 apc_pool_api.h configure
aclocal.m4 apc_pool.c configure.in
apc_api.h apc_pool.h config.w32
apc_bin_api.h apc_rfc1867.c INSTALL
apc_bin.c apc_serializer.h install-sh
apc_bin.h apc_shm.c LICENSE
apc.c apc_shm.h ltmain.sh
apc_cache_api.h apc_signal.c Makefile.frag
apc_cache.c apc_signal.h Makefile.global
apc_cache.h apc_sma_api.h missing
apc_globals.h apc_sma.c mkinstalldirs
apc.h apc_sma.h NOTICE
apc_iterator.c apc_stack.c pgsql_s_lock.c
apc_iterator.h apc_stack.h pgsql_s_lock.h
apc_lock_api.h apc_windows_srwlock_kernel.c php_apc.c
apc_lock.c apc_windows_srwlock_kernel.h php_apc.h
apc_lock.h autom4te.cache README.md
apc_mmap.c build run-tests.php
apc_mmap.h config.guess TECHNOTES.txt
apc.php config.h.in tests
apc_php.h config.m4 TODO
apc_php_pcre.h config.sub
[root@ipo apcu-4.0.11]#
Configure the extention[root@ipo apcu-4.0.11]# ./configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
..
..
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
[root@iport3 apcu-4.0.11]#
[root@iport3 apcu-4.0.11]# ls
acinclude.m4 apc_rfc1867.c config.w32
aclocal.m4 apc_serializer.h include
apc_api.h apc_shm.c INSTALL
apc_bin_api.h apc_shm.h install-sh
apc_bin.c apc_signal.c libtool
apc_bin.h apc_signal.h LICENSE
apc.c apc_sma_api.h ltmain.sh
apc_cache_api.h apc_sma.c Makefile
apc_cache.c apc_sma.h Makefile.frag
apc_cache.h apc_stack.c Makefile.fragments
apc_globals.h apc_stack.h Makefile.global
apc.h apc_windows_srwlock_kernel.c Makefile.objects
apc_iterator.c apc_windows_srwlock_kernel.h missing
apc_iterator.h autom4te.cache mkinstalldirs
apc_lock_api.h build modules
apc_lock.c config.guess NOTICE
apc_lock.h config.h pgsql_s_lock.c
apc_mmap.c config.h.in pgsql_s_lock.h
apc_mmap.h config.log php_apc.c
apc.php config.m4 php_apc.h
apc_php.h config.nice README.md
apc_php_pcre.h config.status run-tests.php
apc_pool_api.h config.sub TECHNOTES.txt
apc_pool.c configure tests
apc_pool.h configure.in TODO
[root@ipo apcu-4.0.11]#
Compile the extention
[root@ipo apcu-4.0.11]# make
/bin/sh /root/apcu-4.0.11/libtool --mode=compile cc -D_GNU_SOURCE -I. -I/root/apcu-4.0.11 -DPHP_ATOM_INC -I/root/apcu-4.0.11/include -I/root/apcu-4.0.11/main -I/root/apcu-4.0.11 -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/apcu-4.0.11/apc.c -o apc.lo
mkdir .libs
cc -D_GNU_SOURCE -I. -I/root/apcu-4.0.11 -DPHP_ATOM_INC -I/root/apcu-4.0.11/include -I/root/apcu-4.0.11/main -I/root/apcu-4.0.11 -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/apcu-4.0.11/apc.c -fPIC -DPIC -o .libs/apc.o
/bin/sh /root/apcu-4.0.11/libtool --mode=compile cc -D_GNU_SOURCE -I. -I/root/apcu-4.0.11 -DPHP_ATOM_INC -I/root/apcu-4.0.11/include -I/root/apcu-4.0.11/main -I/root/apcu-4.0.11 -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/apcu-4.0.11/apc_lock.c -o apc_lock.lo
cc -D_GNU_SOURCE -I. -I/root/apcu-4.0.11 -DPHP_ATOM_INC -I/root/apcu-4.0.11/include -I/root/apcu-4.0.11/main -I/root/apcu-4.0.11 -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/apcu-4.0.11/apc_lock.c -fPIC -DPIC -o .libs/apc_lock.o
/bin/sh /root/apcu-4.0.11/libtool --mode=compile cc -D_GNU_SOURCE -I. -I/root/apcu-4.0.11 -DPHP_ATOM_INC -I/root/apcu-4.0.11/include -I/root/apcu-4.0.11/main -I/root/apcu-4.0.11 -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/apcu-4.0.11/php_apc.c -o php_apc.lo
cc -D_GNU_SOURCE -I. -I/root/apcu-4.0.11 -DPHP_ATOM_INC -I/root/apcu-4.0.11/include -I/root/apcu-4.0.11/main -I/root/apcu-4.0.11 -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/apcu-4.0.11/php_apc.c -fPIC -DPIC -o .libs/php_apc.o
/bin/sh /root/apcu-4.0.11/libtool --mode=compile cc -D_GNU_SOURCE -I. -I/root/apcu-4.0.11 -DPHP_ATOM_INC -I/root/apcu-4.0.11/include -I/root/apcu-4.0.11/main -I/root/apcu-4.0.11 -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/apcu-4.0.11/apc_cache.c -o apc_cache.lo
..
..
/root/apcu-4.0.11/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
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'.
[root@ipo apcu-4.0.11]#
Install the extention
[root@ipo apcu-4.0.11]# make install
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20131226/
Installing header files: /usr/local/php5/include/php/
[root@ipo apcu-4.0.11]#
Enable the extention
[root@ipo apcu-4.0.11]# echo "extension=apc.so" > /etc/php.d/apc.ini
Restart the apache
[root@ipo ~]# service httpd restart
Check the php module
[root@ipo ~]# php -m
Tidak ada komentar :
Posting Komentar