How to install php rar module from source on centos 6
Download the php rar source : http://pecl.php.net/package/rar
[root@localhost ~]# wget http://pecl.php.net/get/rar-4.0.0.tgz
--2018-11-03 22:04:55-- http://pecl.php.net/get/rar-4.0.0.tgz
Connecting to 192.168.71.17:9898... connected.
Proxy request sent, awaiting response... 200 OK
Length: 383732 (375K) [application/octet-stream]
Saving to: “rar-4.0.0.tgz”
100%[============================================================================================>] 383,732 359K/s in 1.0s
2018-11-03 22:04:59 (359 KB/s) - “rar-4.0.0.tgz” saved [383732/383732]
[root@localhost ~]#
[root@localhost ~]# ls
anaconda-ks.cfg bakupan_eplan.tar.gz install.log mysql80-community-release-el6-1.noarch.rpm rar-4.0.0.tgz
apr-1.6.5.tar.gz httpd-2.4.37 install.log.syslog php-5.4.45 wch_backres_eplan.sh
apr-util-1.6.1.tar.gz httpd-2.4.37.tar.gz ius-release.rpm php-5.4.45.tar.gz
[root@localhost ~]#
[root@localhost ~]# tar -xzf rar-4.0.0.tgz
[root@localhost ~]# ls
anaconda-ks.cfg httpd-2.4.37 ius-release.rpm php-5.4.45.tar.gz
apr-1.6.5.tar.gz httpd-2.4.37.tar.gz mysql80-community-release-el6-1.noarch.rpm rar-4.0.0
apr-util-1.6.1.tar.gz install.log package.xml rar-4.0.0.tgz
bakupan_eplan.tar.gz install.log.syslog php-5.4.45 wch_backres_eplan.sh
[root@localhost ~]#
Download php from official website
Install some needed library
[root@localhost ~]# cd rar-4.0.0
[root@localhost rar-4.0.0]# ls
config.m4 CREDITS LICENSE rararch.c rarentry.c rar_navigation.c rar_time.c tests
config.w32 example.php php_rar.h rar.c rar_error.c rar_stream.c README.md unrar
[root@localhost rar-4.0.0]# phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
[root@localhost rar-4.0.0]#
Download php from official website
Install some needed library
[root@localhost ~]# cd rar-4.0.0
[root@localhost rar-4.0.0]# ls
config.m4 CREDITS LICENSE rararch.c rarentry.c rar_navigation.c rar_time.c tests
config.w32 example.php php_rar.h rar.c rar_error.c rar_stream.c README.md unrar
[root@localhost rar-4.0.0]# phpize
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
[root@localhost rar-4.0.0]# ls
acinclude.m4 config.guess configure example.php Makefile.global rararch.c rar_navigation.c run-tests.php
aclocal.m4 config.h.in configure.in install-sh missing rar.c rar_stream.c tests
autom4te.cache config.m4 config.w32 LICENSE mkinstalldirs rarentry.c rar_time.c unrar
build config.sub CREDITS ltmain.sh php_rar.h rar_error.c README.md
[root@localhost rar-4.0.0]#
Download php from official
Install some needed library
[root@localhost rar-4.0.0]# ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php5
checking for PHP includes... -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
checking for PHP extension directory... /usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /usr/local/php5/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking whether to enable rar support... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 1966080
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
[root@localhost rar-4.0.0]#
Download php from official website
Install some needed library
[root@localhost rar-4.0.0]# make
/bin/sh /root/rar-4.0.0/libtool --mode=compile cc -DRARDLL -DSILENT -Wno-write-strings -Wall -I/root/rar-4.0.0/unrar -I. -I/root/rar-4.0.0 -DPHP_ATOM_INC -I/root/rar-4.0.0/include -I/root/rar-4.0.0/main -I/root/rar-4.0.0 -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/rar-4.0.0/rar.c -o rar.lo
mkdir .libs
cc -DRARDLL -DSILENT -Wno-write-strings -Wall -I/root/rar-4.0.0/unrar -I. -I/root/rar-4.0.0 -DPHP_ATOM_INC -I/root/rar-4.0.0/include -I/root/rar-4.0.0/main -I/root/rar-4.0.0 -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/rar-4.0.0/rar.c -fPIC -DPIC -o .libs/rar.o
/bin/sh /root/rar-4.0.0/libtool --mode=compile cc -DRARDLL -DSILENT -Wno-write-strings -Wall -I/root/rar-4.0.0/unrar -I. -I/root/rar-4.0.0 -DPHP_ATOM_INC -I/root/rar-4.0.0/include -I/root/rar-4.0.0/main -I/root/rar-4.0.0 -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/rar-4.0.0/rar_error.c -o rar_error.lo
cc -DRARDLL -DSILENT -Wno-write-strings -Wall -I/root/rar-4.0.0/unrar -I. -I/root/rar-4.0.0 -DPHP_ATOM_INC -I/root/rar-4.0.0/include -I/root/rar-4.0.0/main -I/root/rar-4.0.0 -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/rar-4.0.0/rar_error.c -fPIC -DPIC -o .libs/rar_error.o
/bin/sh /root/rar-4.0.0/libtool --mode=compile cc -DRARDLL -DSILENT -Wno-write-strings -Wall -I/root/rar-4.0.0/unrar -I. -I/root/rar-4.0.0 -DPHP_ATOM_INC -I/root/rar-4.0.0/include -I/root/rar-4.0.0/main -I/root/rar-4.0.0 -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/rar-4.0.0/rararch.c -o rararch.lo
..
..
Libraries have been installed in:
/root/rar-4.0.0/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'.
Download php from official
Download php from official
Download php from official
source
[root@localhost rar-4.0.0]# make install
Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/
[root@localhost rar-4.0.0]#
Install some needed library
source
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; ... or with a path:
;
; extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
extension=rar.so
Install some needed library
source
[root@localhost rar-4.0.0]# service httpd restart
Shutting down httpd: [ OK ]
Starting httpd: [ OK ]
[root@localhost rar-4.0.0]#
Install some needed library
Download php from official
source
[root@localhost rar-4.0.0]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
rar
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib
[Zend Modules]
[root@localhost rar-4.0.0]#
Install some needed library
Tidak ada komentar :
Posting Komentar