lnmp1.8安装exif报错
creating libtoolappending 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.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: *** 错误 1
/root/lnmp1.9/src
Restarting php-fpm......
Gracefully shutting down php-fpm . done
Starting php-fpm 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也报此错误 望回复 感谢
已解决 谢谢 什么系统及版本?
比较老的系统版本吗? Yan 发表于 2022-7-11 15:55
已解决 谢谢
我也是这样的错误,请问是怎么解决的?CentOS 7.9 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.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: *** Error 1
export CFLAGS="-std=c99"
执行后再安装应该就可以了 这方法有用,谢谢。
页:
[1]