VPS侦探论坛

 找回密码
 注册
查看: 2320|回复: 5

lnmp1.8安装exif报错

[复制链接]
发表于 2022-7-11 15:40:44 | 显示全部楼层 |阅读模式

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
/bin/sh /root/lnmp1.9/src/php-8.0.8/ext/exif/libtool --mode=compile cc -I. -I/root/lnmp1.9/src/php-8.0.8/ext/exif -I/root/lnmp1.9/src/php-8.0.8/ext/exif/include -I/root/lnmp1.9/src/php-8.0.8/ext/exif/main -I/root/lnmp1.9/src/php-8.0.8/ext/exif -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c -o exif.lo
mkdir .libs
cc -I. -I/root/lnmp1.9/src/php-8.0.8/ext/exif -I/root/lnmp1.9/src/php-8.0.8/ext/exif/include -I/root/lnmp1.9/src/php-8.0.8/ext/exif/main -I/root/lnmp1.9/src/php-8.0.8/ext/exif -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c  -fPIC -DPIC -o .libs/exif.o
/root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c: 在函数‘add_assoc_image_info’中:
/root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c:2457:2: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
  for (int i = 0; i<image_info->info_list[section_index].count; i++) {
  ^
/root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c:2457:2: 附注:使用 -std=c99 或 -std=gnu99 来编译您的代码
/root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c:2510:6: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
      for (int ap = 0; ap < l; ap++) {
      ^
/root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c:2518:10: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
          for (int b = 0; b < l; b++) {
          ^
/root/lnmp1.9/src/php-8.0.8/ext/exif/exif.c:2544:10: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
          for (int b = 0; b < l; b++) {
          ^
make: *** [exif.lo] 错误 1
/root/lnmp1.9/src
Restarting php-fpm......
Gracefully shutting down php-fpm . done
Starting php-fpm [11-Jul-2022 15:37:42] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library 'exif.so' (tried: /usr/local/php/lib/php/extensions/no-debug-non-zts-20200930/exif.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20200930/exif.so: cannot open shared object file: No such file or directory), /usr/local/php/lib/php/extensions/no-debug-non-zts-20200930/exif.so.so (/usr/local/php/lib/php/extensions/no-debug-non-zts-20200930/exif.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
done
PHP Exif install failed!



1.8版本 报此错误
后下载1.9安装包 执行./addons.sh  也报此错误   望回复 感谢




美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2022-7-11 15:55:50 | 显示全部楼层


已解决 谢谢
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2022-7-11 20:02:56 | 显示全部楼层

什么系统及版本?
比较老的系统版本吗?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2022-7-21 22:11:45 | 显示全部楼层




我也是这样的错误,请问是怎么解决的?CentOS 7.9
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2022-7-22 18:30:58 | 显示全部楼层

freehzw 发表于 2022-7-21 22:11
我也是这样的错误,请问是怎么解决的?CentOS 7.9
_CACHE=1 -c /root/lnmp1.9/src/php-8.0.20/ext/exif/exif.c  -fPIC -DPIC -o .libs/exif.o
/root/lnmp1.9/src/php-8.0.20/ext/exif/exif.c: In function ‘add_assoc_image_info’:
/root/lnmp1.9/src/php-8.0.20/ext/exif/exif.c:2457:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i<image_info->info_list[section_index].count; i++) {
  ^
/root/lnmp1.9/src/php-8.0.20/ext/exif/exif.c:2457:2: note: use option -std=c99 or -std=gnu99 to compile your code
/root/lnmp1.9/src/php-8.0.20/ext/exif/exif.c:2510:6: error: ‘for’ loop initial declarations are only allowed in C99 mode
      for (int ap = 0; ap < l; ap++) {
      ^
/root/lnmp1.9/src/php-8.0.20/ext/exif/exif.c:2518:10: error: ‘for’ loop initial declarations are only allowed in C99 mode
          for (int b = 0; b < l; b++) {
          ^
/root/lnmp1.9/src/php-8.0.20/ext/exif/exif.c:2544:10: error: ‘for’ loop initial declarations are only allowed in C99 mode
          for (int b = 0; b < l; b++) {
          ^
make: *** [exif.lo] Error 1


export CFLAGS="-std=c99"
执行后再安装应该就可以了

军哥运维代购:http://shop63846532.taobao.com/

发表于 2022-7-24 23:40:25 | 显示全部楼层

这方法有用,谢谢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-24 01:56 , Processed in 0.027106 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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