失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > php安装vld扩展

php安装vld扩展

时间:2024-02-06 23:35:55

相关推荐

php安装vld扩展

1、查看本地是否已经安装了vld扩展,如果没有任何输出,那就准备安装吧!

[root@taiwu ~]# /home/work/lib/php5.6.7/bin/php -m | grep vld

2、去官方网站下载vld(/package/vld), 找到最新版本,右键复制地址链接就能得到下载地址,通过浏览器直接下载也行。

我是通过wget命令在centos的命令行执行,进行下载(wget /get/vld-0.14.0.tgz)

[root@liuchao taiwu]# wget /get/vld-0.14.0.tgz---03-01 17:15:47-- /get/vld-0.14.0.tgz正在解析主机 ... 104.236.228.160正在连接 |104.236.228.160|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:20506 (20K) [application/octet-stream]正在保存至: “vld-0.14.0.tgz”100%[===================================================================================================================================>] 20,50631.0K/s in 0.6s -03-01 17:15:49 (31.0 KB/s) - 已保存 “vld-0.14.0.tgz” [20506/20506])[root@taiwu taiwu]# ls -al总用量 28drwxr-xr-x. 2 root root 27 3月 1 17:15 .dr-xr-x--x. 7 root root 4096 3月 1 17:15 ..-rw-r--r--. 1 root root 20506 12月 19 vld-0.14.0.tgz

3、执行安装vld扩展的步骤

解压下载的tar包,进入解压后的目录

tar zxvf vld-0.14.0.tgz cd vld-0.14.0

执行

/home/work/lib/php5.6.7/bin/phpize

知道php-config路径(用命令locate php-config可以得到),然后执行

./configure --with-php-config=/home/work/lib/php5.6.7/bin/php-config --enable-vld

然后执行

make && make install

[root@liuchao taiwu]# lsvld-0.14.0.tgz[root@liuchao taiwu]# tar zxvf vld-0.14.0.tgz package.xmlvld-0.14.0/branchinfo.cvld-0.14.0/branchinfo.hvld-0.14.0/Changelogvld-0.14.0/config.m4vld-0.14.0/config.w32vld-0.14.0/CREDITSvld-0.14.0/LICENSEvld-0.14.0/README.rstvld-0.14.0/Makefile.invld-0.14.0/php_vld.hvld-0.14.0/set.cvld-0.14.0/set.hvld-0.14.0/srm_oparray.cvld-0.14.0/srm_oparray.hvld-0.14.0/vld.c[root@liuchao taiwu]# cd vld-0.14.0[root@liuchao vld-0.14.0]# /home/work/lib/php5.6.7/bin/phpizeConfiguring for:PHP Api Version: 1106Zend Module Api No: 1226Zend Extension Api No: 21226[root@liuchao vld-0.14.0]# locate php-config/home/work/lib/php5.6.7/bin/php-config/home/work/lib/php5.6.7/php/man/man1/php-config.1/home/work/lib/php5.6.7_1/bin/php-config/home/work/lib/php5.6.7_1/php/man/man1/php-config.1[root@liuchao vld-0.14.0]# ./configure --with-php-config=/home/work/lib/php5.6.7/bin/php-config --enable-vldchecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for a sed that does not truncate output... /bin/sedchecking for cc... ccchecking for C compiler default output file name... a.outchecking whether the C compiler works... yeschecking whether we are cross compiling... nochecking for suffix of executables... checking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether cc accepts -g... yeschecking for cc option to accept ISO C89... none neededchecking how to run the C preprocessor... cc -Echecking for icc... nochecking for suncc... nochecking whether cc understands -c and -o together... yeschecking for system library directory... libchecking if compiler supports -R... nochecking if compiler supports -Wl,-rpath,... yeschecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type... x86_64-unknown-linux-gnuchecking for PHP prefix... /home/work/lib/php5.6.7checking for PHP includes... -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/libchecking for PHP extension directory... /home/work/lib/php5.6.7/lib/php/extensions/no-debug-non-zts-1226checking for PHP installed headers prefix... /home/work/lib/php5.6.7/include/phpchecking if debug is enabled... nochecking if zts is enabled... nochecking for re2c... re2cchecking for re2c version... 0.13.7.5 (ok)checking for gawk... gawkchecking whether to enable vld support... yes, sharedchecking for ld used by cc... /usr/bin/ldchecking if the linker (/usr/bin/ld) is GNU ld... yeschecking for /usr/bin/ld option to reload object files... -rchecking for BSD-compatible nm... /usr/bin/nm -Bchecking whether ln -s works... yeschecking how to recognize dependent libraries... pass_allchecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking dlfcn.h usability... yeschecking dlfcn.h presence... yeschecking for dlfcn.h... yeschecking the maximum length of command line arguments... 1572864checking command to parse /usr/bin/nm -B output from cc object... okchecking for objdir... .libschecking for ar... archecking for ranlib... ranlibchecking for strip... stripchecking if cc supports -fno-rtti -fno-exceptions... nochecking for cc option to produce PIC... -fPICchecking if cc PIC flag -fPIC works... yeschecking if cc static flag -static works... nochecking if cc supports -c -o file.o... yeschecking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yeschecking whether -lc should be explicitly linked in... nochecking dynamic linker characteristics... GNU/Linux ld.sochecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries... yeschecking whether to build shared libraries... yeschecking whether to build static libraries... nocreating libtoolappending configuration tag "CXX" to libtoolconfigure: creating ./config.statusconfig.status: creating config.h[root@liuchao vld-0.14.0]# make && make install/bin/sh /root/taiwu/vld-0.14.0/libtool --mode=compile cc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/vld.c -o vld.lo mkdir .libscc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/vld.c -fPIC -DPIC -o .libs/vld.o/bin/sh /root/taiwu/vld-0.14.0/libtool --mode=compile cc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/srm_oparray.c -o srm_oparray.lo cc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/srm_oparray.c -fPIC -DPIC -o .libs/srm_oparray.o/bin/sh /root/taiwu/vld-0.14.0/libtool --mode=compile cc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/set.c -o set.lo cc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/set.c -fPIC -DPIC -o .libs/set.o/bin/sh /root/taiwu/vld-0.14.0/libtool --mode=compile cc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/branchinfo.c -o branchinfo.lo cc -I. -I/root/taiwu/vld-0.14.0 -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/taiwu/vld-0.14.0/branchinfo.c -fPIC -DPIC -o .libs/branchinfo.o/bin/sh /root/taiwu/vld-0.14.0/libtool --mode=link cc -DPHP_ATOM_INC -I/root/taiwu/vld-0.14.0/include -I/root/taiwu/vld-0.14.0/main -I/root/taiwu/vld-0.14.0 -I/home/work/lib/php5.6.7/include/php -I/home/work/lib/php5.6.7/include/php/main -I/home/work/lib/php5.6.7/include/php/TSRM -I/home/work/lib/php5.6.7/include/php/Zend -I/home/work/lib/php5.6.7/include/php/ext -I/home/work/lib/php5.6.7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o vld.la -export-dynamic -avoid-version -prefer-pic -module -rpath /root/taiwu/vld-0.14.0/modules vld.lo srm_oparray.lo set.lo branchinfo.lo cc -shared .libs/vld.o .libs/srm_oparray.o .libs/set.o .libs/branchinfo.o -Wl,-soname -Wl,vld.so -o .libs/vld.socreating vld.la(cd .libs && rm -f vld.la && ln -s ../vld.la vld.la)/bin/sh /root/taiwu/vld-0.14.0/libtool --mode=install cp ./vld.la /root/taiwu/vld-0.14.0/modulescp ./.libs/vld.so /root/taiwu/vld-0.14.0/modules/vld.socp ./.libs/vld.lai /root/taiwu/vld-0.14.0/modules/vld.laPATH="$PATH:/sbin" ldconfig -n /root/taiwu/vld-0.14.0/modules----------------------------------------------------------------------Libraries have been installed in:/root/taiwu/vld-0.14.0/modulesIf you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify 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 variableduring execution- add LIBDIR to the `LD_RUN_PATH' environment variableduring 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 formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------Build complete.Don't forget to run 'make test'.Installing shared extensions: /home/work/lib/php5.6.7/lib/php/extensions/no-debug-non-zts-1226/[root@liuchao vld-0.14.0]#

最终可以看到,扩展安装到了如下目录中( /home/work/lib/php5.6.7/lib/php/extensions/no-debug-non-zts-1226/)

4、安装好了vld扩展以后,进行配置php.ini

*通过locate命令轻松找到php.ini的路径

[root@liuchao vld-0.14.0]# locate php.ini/home/work/lib/php5.6.7/etc/php.ini[root@liuchao vld-0.14.0]# vi /home/work/lib/php5.6.7/etc/php.ini

配置文件中已经有了扩展的路径配置

加上扩展配置(extension=vld.so)

5、对应通过命令行执行的php,已经可以用vld了

创建一个php脚本

[root@liuchao vld-0.14.0]# echo '<?php echo 123;' > 1.php

执行脚本

[root@liuchao vld-0.14.0]# /home/work/lib/php5.6.7/bin/php -dvld.active=1 1.phpFinding entry pointsBranch analysis from position: 0Jump found. (Code = 62) Position 1 = -2filename: /root/taiwu/vld-0.14.0/1.phpfunction name: (null)number of ops: 2compiled vars: noneline#* E I O op fetchext return operands-------------------------------------------------------------------------------------10 E > ECHO 12321> RETURN 1branch: # 0; line:1- 2; sop:0; eop:1; out1: -2path #1: 0, 123[root@liuchao vld-0.14.0]#

如果觉得《php安装vld扩展》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。