当前位置:论坛首页 > Linux面板 > 求助

【已解决】安装fileinfo-81错误

发表在 Linux面板2022-1-5 21:45 [复制链接] 4 3961

本帖最后由 堡塔运维香菜卷 于 2023-3-30 09:51 编辑

安装php8.1的fileinfo错误,

CentOS  7.6.1810 x86_64(Py3.7.9)






  1. /bin/sh /www/server/php/81/src/ext/fileinfo/libtool --mode=compile /opt/rh/devtoolset-7/root/usr/bin/gcc -I. -I/www/server/php/81/src/ext/fileinfo -I/www/server/php/81/src/ext/fileinfo/include -I/www/server/php/81/src/ext/fileinfo/main -I/www/server/php/81/src/ext/fileinfo -I/www/server/php/81/include/php -I/www/server/php/81/include/php/main -I/www/server/php/81/include/php/TSRM -I/www/server/php/81/include/php/Zend -I/www/server/php/81/include/php/ext -I/www/server/php/81/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -I/www/server/php/81/src/ext/fileinfo/libmagic -DZEND_COMPILE_DL_EXT=1 -c /www/server/php/81/src/ext/fileinfo/libmagic/softmagic.c -o libmagic/softmagic.lo  -MMD -MF libmagic/softmagic.dep -MT libmagic/softmagic.lo
  2. /opt/rh/devtoolset-7/root/usr/bin/gcc -I. -I/www/server/php/81/src/ext/fileinfo -I/www/server/php/81/src/ext/fileinfo/include -I/www/server/php/81/src/ext/fileinfo/main -I/www/server/php/81/src/ext/fileinfo -I/www/server/php/81/include/php -I/www/server/php/81/include/php/main -I/www/server/php/81/include/php/TSRM -I/www/server/php/81/include/php/Zend -I/www/server/php/81/include/php/ext -I/www/server/php/81/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -I/www/server/php/81/src/ext/fileinfo/libmagic -DZEND_COMPILE_DL_EXT=1 -c /www/server/php/81/src/ext/fileinfo/libmagic/softmagic.c -MMD -MF libmagic/softmagic.dep -MT libmagic/softmagic.lo  -fPIC -DPIC -o libmagic/.libs/softmagic.o
  3. In file included from /usr/include/string.h:633:0,
  4.                  from /www/server/php/81/include/php/main/../main/php_config.h:2210,
  5.                  from /www/server/php/81/include/php/Zend/zend_config.h:1,
  6.                  from /www/server/php/81/include/php/Zend/zend_portability.h:43,
  7.                  from /www/server/php/81/include/php/Zend/zend_types.h:25,
  8.                  from /www/server/php/81/include/php/Zend/zend.h:27,
  9.                  from /www/server/php/81/include/php/main/php.h:31,
  10.                  from /www/server/php/81/src/ext/fileinfo/libmagic/config.h:1,
  11.                  from /www/server/php/81/src/ext/fileinfo/libmagic/file.h:36,
  12.                  from /www/server/php/81/src/ext/fileinfo/libmagic/softmagic.c:32:
  13. /www/server/php/81/src/ext/fileinfo/libmagic/softmagic.c:507:7: error: expected identifier or ‘(’ before ‘__extension__’
  14. char *strndup(const char *, size_t);
  15.        ^
  16. /www/server/php/81/src/ext/fileinfo/libmagic/softmagic.c:510:1: error: expected identifier or ‘(’ before ‘__extension__’
  17. strndup(const char *str, size_t n)
  18. ^
  19. make: *** [libmagic/softmagic.lo] Error 1
  20. error
复制代码




使用道具 举报 只看该作者 回复
发表于 2022-1-5 22:40:37 | 显示全部楼层
centos7系列php8.1的fileinfo暂时还不支持
使用道具 举报 回复 支持 反对
发表于 2022-3-14 19:21:11 | 显示全部楼层
怎么解决的?
使用道具 举报 回复 支持 反对
发表于 2022-3-14 20:46:49 | 显示全部楼层
  1. cd /www/server/php/81/src/ext/fileinfo/
  2. /www/server/php/81/bin/phpize
  3. ./configure --with-php-config=/www/server/php/81/bin/php-config
  4. sed -i "s#CFLAGS = -g -O2#CFLAGS = -std=c99 -g#g" Makefile
  5. make && make install
  6. echo "extension=/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so" >> /www/server/php/81/etc/php.ini
  7. echo "extension=/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so" >> /www/server/php/81/etc/php-cli.ini
  8. /etc/init.d/php-fpm-81 restart
复制代码


试试这个方法,看安装是否正常
使用道具 举报 回复 支持 反对
发表于 2023-3-29 14:30:15 | 显示全部楼层
堡塔安全赤井秀一 发表于 2022-3-14 20:46
试试这个方法,看安装是否正常

这个可以解决的,感谢~
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理

工作时间:09:00至24:00

快速回复 返回顶部 返回列表