laruence / yaconf

A PHP Persistent Configurations Container

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP73 编译扩展时出问题,pecl 装也会有这个错误

m9rco opened this issue · comments

make的时候出现这个异常了

mkdir .libs
 cc -I. -I/app/yaconf-yaconf-1.0.6 -DPHP_ATOM_INC -I/app/yaconf-yaconf-1.0.6/include -I/app/yaconf-yaconf-1.0.6/main -I/app/yaconf-yaconf-1.0.6 -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /app/yaconf-yaconf-1.0.6/yaconf.c  -fPIC -DPIC -o .libs/yaconf.o
/app/yaconf-yaconf-1.0.6/yaconf.c: In function 'php_yaconf_hash_init':
/app/yaconf-yaconf-1.0.6/yaconf.c:92:15: error: lvalue required as left operand of assignment
  GC_FLAGS(ht) |= IS_ARRAY_IMMUTABLE;
               ^~
/app/yaconf-yaconf-1.0.6/yaconf.c:93:18: error: lvalue required as left operand of assignment
  GC_REFCOUNT(ht) = 2;
                  ^
/app/yaconf-yaconf-1.0.6/yaconf.c:98:23: error: 'IS_TYPE_COPYABLE' undeclared (first use in this function)
  Z_TYPE_FLAGS_P(zv) = IS_TYPE_COPYABLE;
                       ^~~~~~~~~~~~~~~~
/app/yaconf-yaconf-1.0.6/yaconf.c:98:23: note: each undeclared identifier is reported only once for each function it appears in
/app/yaconf-yaconf-1.0.6/yaconf.c: In function 'php_yaconf_str_persistent':
/app/yaconf-yaconf-1.0.6/yaconf.c:144:16: error: lvalue required as left operand of assignment
  GC_FLAGS(key) |= IS_STR_INTERNED | IS_STR_PERMANENT;
                ^~
/app/yaconf-yaconf-1.0.6/yaconf.c: In function 'php_yaconf_zval_persistent':
/app/yaconf-yaconf-1.0.6/yaconf.c:166:8: error: 'IS_CONSTANT' undeclared (first use in this function)
   case IS_CONSTANT:
        ^~~~~~~~~~~
make: *** [Makefile:194: yaconf.lo] Error 1

试了下1.0.7 也会有这种情况

#endif

set -ex \
    && wget -O yafconf.zip https://github.com/laruence/yaconf/archive/yaconf-1.0.6.zip \
    && unzip yafconf.zip \
    && cd yaconf-yaconf-1.0.6 \
    && phpize \
    && ./configure --with-php-config=php-config \
    && make && make install \
    && cd ../ \
    && rm -rf *

看起来是PHP版本太高了,好吧 http://pecl.php.net/package/yaconf