宝塔面板php8.1安装fileinfo失败或无法安装的解决方案
短信预约 -IT技能 免费直播动态提醒
宝塔面板安装php8.1的fileinfo错误,网上说修改swap大小我试过基本都没什么用
/bin/sh /www/server/php/81/class="lazy" data-src/ext/fileinfo/libtool --mode=compile /opt/rh/devtoolset-7/root/usr/bin/gcc -I. -I/www/server/php/81/class="lazy" data-src/ext/fileinfo -I/www/server/php/81/class="lazy" data-src/ext/fileinfo/include -I/www/server/php/81/class="lazy" data-src/ext/fileinfo/main -I/www/server/php/81/class="lazy" data-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/class="lazy" data-src/ext/fileinfo/libmagic -DZEND_COMPILE_DL_EXT=1 -c /www/server/php/81/class="lazy" data-src/ext/fileinfo/libmagic/softmagic.c -o libmagic/softmagic.lo -MMD -MF libmagic/softmagic.dep -MT libmagic/softmagic.lo /opt/rh/devtoolset-7/root/usr/bin/gcc -I. -I/www/server/php/81/class="lazy" data-src/ext/fileinfo -I/www/server/php/81/class="lazy" data-src/ext/fileinfo/include -I/www/server/php/81/class="lazy" data-src/ext/fileinfo/main -I/www/server/php/81/class="lazy" data-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/class="lazy" data-src/ext/fileinfo/libmagic -DZEND_COMPILE_DL_EXT=1 -c /www/server/php/81/class="lazy" data-src/ext/fileinfo/libmagic/softmagic.c -MMD -MF libmagic/softmagic.dep -MT libmagic/softmagic.lo -fPIC -DPIC -o libmagic/.libs/softmagic.oIn file included from /usr/include/string.h:633:0, from /www/server/php/81/include/php/main/../main/php_config.h:2210, from /www/server/php/81/include/php/Zend/zend_config.h:1, from /www/server/php/81/include/php/Zend/zend_portability.h:43, from /www/server/php/81/include/php/Zend/zend_types.h:25, from /www/server/php/81/include/php/Zend/zend.h:27, from /www/server/php/81/include/php/main/php.h:31, from /www/server/php/81/class="lazy" data-src/ext/fileinfo/libmagic/config.h:1, from /www/server/php/81/class="lazy" data-src/ext/fileinfo/libmagic/file.h:36, from /www/server/php/81/class="lazy" data-src/ext/fileinfo/libmagic/softmagic.c:32:/www/server/php/81/class="lazy" data-src/ext/fileinfo/libmagic/softmagic.c:507:7: error: expected identifier or ‘(’ before ‘__extension__’ char *strndup(const char *, size_t); ^/www/server/php/81/class="lazy" data-src/ext/fileinfo/libmagic/softmagic.c:510:1: error: expected identifier or ‘(’ before ‘__extension__’ strndup(const char *str, size_t n) ^make: *** [libmagic/softmagic.lo] Error 1error
处理方式:
cd /www/server/php/81/class="lazy" data-src/ext/fileinfo//www/server/php/81/bin/phpize./configure --with-php-config=/www/server/php/81/bin/php-configsed -i "s#CFLAGS = -g -O2#CFLAGS = -std=c99 -g#g" Makefilemake && make installecho "extension=/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so" >> /www/server/php/81/etc/php.iniecho "extension=/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so" >> /www/server/php/81/etc/php-cli.ini/etc/init.d/php-fpm-81 restart
然后去看fileinfo插件就安装成功了
来源地址:https://blog.csdn.net/memeguigui/article/details/129836186
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341