今日应开发需求,想要显示图片的属性信息,于是度娘就告知exif模块可以实现,操作步骤与问题总结吐下;
一、环境介绍
[root@ghzz~]#cat/etc/redhat-release CentOSrelease6.5(Final) Youhavenewmailin/var/spool/mail/root [root@ghzz~]#@R_301_461@-v ZendGuardLoaderrequiresZendEngineAPIversion220121212. TheZendEngineAPIversion220131226whichisinstalled,isnewer. ContactZendTechnologiesathttp://www.zend.com/foralaterversionofZendGuardLoader. @R_301_461@5.6.14(cli)(built:Jul7201612:43:11) Copyright(c)1997-2015The@R_301_461@Group ZendEnginev2.6.0,Copyright(c)1998-2015ZendTechnologies withZendOPcachev7.0.6-dev,Copyright(c)1999-2015,byZendTechnologies
二、查找模块
方法一:去@R_301_461@安装路径下ext目录下都是模块
cd /root/software/@R_301_461@-5.6.14/ext/exif
###这个模块,应该是@R_301_461@安装包内自带的,但是./configure编译安装的时候没有加载的包
@R_301_461@官网地址:http://pecl.php.net/packages.php
三、编译安装 (加载模块)
1)进入@R_301_461@存储模块目录
[root@ghzzlsolesen-pel-56d1b7f]#cd/root/software/@R_301_461@-5.6.14/ext/exif [root@ghzzexif]#ll 总用量196 -rw-r--r--1100010003339月302015config.m4 -rw-r--r--1100010003089月302015config.w32 -rw-r--r--110001000369月302015CREDITS -rw-r--r--1100010004969月302015example.@R_301_461@ -rw-r--r--1100010001453319月302015exif.c -rw-r--r--11000100049339月302015exif.dsp -rw-r--r--11000100019539月302015package.xml -rw-r--r--11000100014639月302015@R_301_461@_exif.h -rw-r--r--110001000299月302015test.@R_301_461@ drwxr-xr-x21000100040969月302015tests -rw-r--r--110001000112329月302015test.txt
2)使用@R_301_461@ize添加@R_301_461@动态模块
[root@ghzzexif]#/usr/local/@R_301_461@/bin/@R_301_461@ize Configuringfor: @R_301_461@ApiVersion:20131106 ZendModuleApiNo:20131226 ZendExtensionApiNo:220131226 [root@ghzzexif]#./configure-with-@R_301_461@-config=/usr/local/@R_301_461@/bin/@R_301_461@-config checkingforgrepthathandleslonglinesand-e.../bin/grep #。。。省略若干字段 checkingwhetherstrippinglibrariesispossible...yes checkingiflibtoolsupportssharedlibraries...yes checkingwhethertobuildsharedlibraries...yes checkingwhethertobuildstaticlibraries...no creatinglibtool appendingconfigurationtag"CXX"tolibtool configure:creating./config.status config.status:creatingconfig.h [root@ghzzexif]#make&&makeinstall /bin/sh/root/software/@R_301_461@-5.6.14/ext/exif/libtool--mode=compilecc-I.-I/root/software/@R_301_461@-5.6.14/ext/exif-D@R_301_461@_ATOM_INC-I/root/software/@R_301_461@-5.6.14/ext/exif/include-I/root/software/@R_301_461@-5.6.14/ext/exif/main-I/root/software/@R_301_461@-5.6.14/ext/exif-I/usr/local/@R_301_461@/include/@R_301_461@-I/usr/local/@R_301_461@/include/@R_301_461@/main-I/usr/local/@R_301_461@/include/@R_301_461@/TSRM-I/usr/local/@R_301_461@/include/@R_301_461@/Zend-I/usr/local/@R_301_461@/include/@R_301_461@/ext-I/usr/local/@R_301_461@/include/@R_301_461@/ext/date/lib-DHAVE_CONFIG_H-g-O2-c/root/software/@R_301_461@-5.6.14/ext/exif/exif.c-oexif.lo mkdir.libs cc-I.-I/root/software/@R_301_461@-5.6.14/ext/exif-D@R_301_461@_ATOM_INC-I/root/software/@R_301_461@-5.6.14/ext/exif/include-I/root/software/@R_301_461@-5.6.14/ext/exif/main-I/root/software/@R_301_461@-5.6.14/ext/exif-I/usr/local/@R_301_461@/include/@R_301_461@-I/usr/local/@R_301_461@/include/@R_301_461@/main-I/usr/local/@R_301_461@/include/@R_301_461@/TSRM-I/usr/local/@R_301_461@/include/@R_301_461@/Zend-I/usr/local/@R_301_461@/include/@R_301_461@/ext-I/usr/local/@R_301_461@/include/@R_301_461@/ext/date/lib-DHAVE_CONFIG_H-g-O2-c/root/software/@R_301_461@-5.6.14/ext/exif/exif.c-fPIC-DPIC-o.libs/exif.o /bin/sh/root/software/@R_301_461@-5.6.14/ext/exif/libtool--mode=linkcc-D@R_301_461@_ATOM_INC-I/root/software/@R_301_461@-5.6.14/ext/exif/include-I/root/software/@R_301_461@-5.6.14/ext/exif/main-I/root/software/@R_301_461@-5.6.14/ext/exif-I/usr/local/@R_301_461@/include/@R_301_461@-I/usr/local/@R_301_461@/include/@R_301_461@/main-I/usr/local/@R_301_461@/include/@R_301_461@/TSRM-I/usr/local/@R_301_461@/include/@R_301_461@/Zend-I/usr/local/@R_301_461@/include/@R_301_461@/ext-I/usr/local/@R_301_461@/include/@R_301_461@/ext/date/lib-DHAVE_CONFIG_H-g-O2-oexif.la-export-dynamic-avoid-version-prefer-pic-module-rpath/root/software/@R_301_461@-5.6.14/ext/exif/modulesexif.lo cc-shared.libs/exif.o-Wl,-soname-Wl,exif.so-o.libs/exif.so creatingexif.la (cd.libs&&rm-fexif.la&&ln-s../exif.laexif.la) /bin/sh/root/software/@R_301_461@-5.6.14/ext/exif/libtool--mode=installcp./exif.la/root/software/@R_301_461@-5.6.14/ext/exif/modules cp./.libs/exif.so/root/software/@R_301_461@-5.6.14/ext/exif/modules/exif.so cp./.libs/exif.lai/root/software/@R_301_461@-5.6.14/ext/exif/modules/exif.la PATH="$PATH:/sbin"ldconfig-n/root/software/@R_301_461@-5.6.14/ext/exif/modules ---------------------------------------------------------------------- Librarieshavebeeninstalledin: /root/software/@R_301_461@-5.6.14/ext/exif/modules Ifyoueverhappentowanttolinkagainstinstalledlibraries inagivendirectory,LIBDIR,youmusteitheruselibtool,and specifythefullpathnameofthelibrary,orusethe`-LLIBDIR' flagduringlinkinganddoatleastoneofthefollowing: -addLIBDIRtothe`LD_LIBRARY_PATH'environmentvariable duringexecution -addLIBDIRtothe`LD_RUN_PATH'environmentvariable duringlinking -usethe`-Wl,--rpath-Wl,LIBDIR'linkerflag -haveyoursystemadministratoraddLIBDIRto`/etc/ld.so.conf' Seeanyoperatingsystemdocumentationaboutsharedlibrariesfor moreinformation,suchastheld(1)andld.so(8)manualpages. ---------------------------------------------------------------------- Buildcomplete. Don'tforgettorun'maketest'. Installingsharedextensions:/usr/local/@R_301_461@/lib/@R_301_461@/extensions/no-debug-non-zts-20131226/ [root@ghzzexif]#vi/usr/local/@R_301_461@/etc/@R_301_461@.ini 查找:extension=再最后一个extension=后面添加上extension=“exif.so” [root@ghzzext]#grep-n"exif.so"/usr/local/@R_301_461@/etc/@R_301_461@.ini 743:extension="exif.so" [root@ghzzexif]#/etc/init.d/@R_301_461@-fpmrestart##重启加载@R_301_461@模块
四、检查模块运行情况及效果
[root@ghzzext]#@R_301_461@-m|grepexif exif