前言
宝塔面板问题解决 – PHP安装不上fileinfo扩展?
不知道大家在使用宝塔面板的时候,为PHP安装fileinfo扩展感到非常苦恼?
我前两天为我的PHP7.4安装fileinfo扩展时,怎么安装都安装不上,然后在网上找各种此问题的解决方案,但是都没有解决我的这个问题。
最后实在找不到此问题的解决方案了,干脆靠自己吧。分析分析扩展安装时的日志看看问题到底出错在哪里。因为我的服务器是4核4G的,首先排除因内存小的原因导致安装不上。
以下是扩展安装时的日志:
Connecting to na1-node.bt.cn (na1-node.bt.cn)|128.1.164.196|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5435 (5.3K) [application/octet-stream]
Saving to: ‘fileinfo.sh’
0K ..... 100% 213M=0s
2023-07-06 11:13:40 (213 MB/s) - ‘fileinfo.sh’ saved [5435/5435]
正在选择下载节点...
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
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 pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 we are cross compiling... no
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 for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /www/server/php/74
checking for PHP includes... -I/www/server/php/74/include/php -I/www/server/php/74/include/php/main -I/www/server/php/74/include/php/TSRM -I/www/server/php/74/include/php/Zend -I/www/server/php/74/include/php/ext -I/www/server/php/74/include/php/ext/date/lib
checking for PHP extension directory... /www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902
checking for PHP installed headers prefix... /www/server/php/74/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for fileinfo support... yes, shared
checking for strcasestr... yes
checking for utimes... yes
checking for strndup... yes
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for /bin/ld option to reload object files... -r
checking for BSD-compatible nm... /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 the maximum length of command line arguments... 1572864
checking command to parse /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 (/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
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
/bin/sh /www/server/php/74/src/ext/fileinfo/libtool --mode=link cc -DPHP_ATOM_INC -I/www/server/php/74/src/ext/fileinfo/include -I/www/server/php/74/src/ext/fileinfo/main -I/www/server/php/74/src/ext/fileinfo -I/www/server/php/74/include/php -I/www/server/php/74/include/php/main -I/www/server/php/74/include/php/TSRM -I/www/server/php/74/include/php/Zend -I/www/server/php/74/include/php/ext -I/www/server/php/74/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o fileinfo.la -export-dynamic -avoid-version -prefer-pic -module -rpath /www/server/php/74/src/ext/fileinfo/modules fileinfo.lo libmagic/apprentice.lo libmagic/apptype.lo libmagic/ascmagic.lo libmagic/cdf.lo libmagic/cdf_time.lo libmagic/compress.lo libmagic/encoding.lo libmagic/fsmagic.lo libmagic/funcs.lo libmagic/is_json.lo libmagic/is_tar.lo libmagic/magic.lo libmagic/print.lo libmagic/readcdf.lo libmagic/softmagic.lo libmagic/der.lo libmagic/buffer.lo
libtool: link: `libmagic/buffer.lo' is not a valid libtool object
make: *** [Makefile:231: fileinfo.la] Error 1
error
|-Successify --- 命令已执行! ---
libtool: link: `libmagic/buffer.lo' is not a valid libtool object
问题解决
sudo yum install gcc libtool autoconf
cd /www/server/php/74/src/ext/fileinfo
make clean
cd /www/server/php/74/src/ext/fileinfo
/www/server/php/74/bin/phpize
./configure --with-php-config=/www/server/php/74/bin/php-config
make
Build complete.
Don't forget to run 'make test'.
make install
/www/server/php/74/etc/php.ini)在该配置文件最后写上以下内容:
extension=fileinfo
sudo systemctl restart nginx
注意事项
- 本网站名称:爱玩博客 - 知识分享有声有色
- 本站永久网址:https://www.luvwan.com/
- 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请点击 侵权联系 进行删除处理。
- 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
- 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报。
- 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
- 本站采用 知识共享署名-非商业性使用-相同方式共享4.0国际许可协议 进行许可。
- 声明:根据中华人民共和国《计算机软件保护条例》第十七条规定:"为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬。"本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有。若您需要使用非免费的软件或服务,请购买正版授权并合法使用。本站发布的内容若侵犯到您的权益,请联系站长删除,我们将及时处理。用户本人下载后不能用作商业或非法用途,需在24小时之内删除,否则后果均由用户承担责任。












课代表

前天0
节点可能挂了吧,你换个协议试试,或者等更新。