Cphalcon: [BUG]: Compiling 3.4.4 for PHP 7.4

Created on 12 Dec 2019  Â·  2Comments  Â·  Source: phalcon/cphalcon

Describe the bug
Phalcon 3.4.4 does not compile for php 7.4

git checkout tags/v3.4.4
cd build
./install

find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la      modules/* libs/*
Cleaning..
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
appending configuration tag "CXX" to libtool
mkdir .libs
 gcc -I. -I/root/cphalcon/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon/build/php7/64bits/include -I/root/cphalcon/build/php7/64bits/main -I/root/cphalcon/build/php7/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -mtune=native -O2 -fomit-frame-pointer -c /root/cphalcon/build/php7/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
/root/cphalcon/build/php7/64bits/phalcon.zep.c: In function ‘zephir_lookup_class_ce’:
/root/cphalcon/build/php7/64bits/phalcon.zep.c:5106:119: error: ‘ZEND_ACC_SHADOW’ undeclared (first use in this function); did you mean ‘ZEND_ACC_STATIC’?
 5106 |   if ((info = zend_hash_str_find_ptr(&ce->properties_info, property_name, property_length)) != NULL && (info->flags & ZEND_ACC_SHADOW) != ZEND_ACC_SHADOW)  {
      |                                                                                                                       ^~~~~~~~~~~~~~~
      |                                                                                                                       ZEND_ACC_STATIC
/root/cphalcon/build/php7/64bits/phalcon.zep.c:5106:119: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:192: phalcon.lo] Error 1
 gcc -I. -I/root/cphalcon/build/php7/64bits -DPHP_ATOM_INC -I/root/cphalcon/build/php7/64bits/include -I/root/cphalcon/build/php7/64bits/main -I/root/cphalcon/build/php7/64bits -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -mtune=native -O2 -fomit-frame-pointer -c /root/cphalcon/build/php7/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
/root/cphalcon/build/php7/64bits/phalcon.zep.c: In function ‘zephir_lookup_class_ce’:
/root/cphalcon/build/php7/64bits/phalcon.zep.c:5106:119: error: ‘ZEND_ACC_SHADOW’ undeclared (first use in this function); did you mean ‘ZEND_ACC_STATIC’?
 5106 |   if ((info = zend_hash_str_find_ptr(&ce->properties_info, property_name, property_length)) != NULL && (info->flags & ZEND_ACC_SHADOW) != ZEND_ACC_SHADOW)  {
      |                                                                                                                       ^~~~~~~~~~~~~~~
      |                                                                                                                       ZEND_ACC_STATIC
/root/cphalcon/build/php7/64bits/phalcon.zep.c:5106:119: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:192: phalcon.lo] Error 1

Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation

Expected behavior
Module is compiled

Details

  • Phalcon version: 3.4.4
  • PHP Version: 7.4
  • Operating System: Arch
  • Installation type: Compiling from source
duplicate not a bug

Most helpful comment

Is there any chance a new version 3.4.6 could be create with PHP 7.4 support? I have an application running on an old version of Phalcon and moving to Phalcon 4.0 involves more changes that I am capable of making with my limited knowledge of Phalon.
I know this is not your problem, but it would really get me (and possibly other who follow) out of a deep hole.

The error I get when trying to "make" 3.5.5 is:

/tmp/cphalcon/build/php7/64bits/phalcon.zep.c:7707:3: error: too many arguments to function 'php_pcre_match_impl'
   php_pcre_match_impl(pce, Z_STRVAL_P(subject), Z_STRLEN_P(subject), return_value, &tmp_matches, global, 0, 0, 0);
   ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/php/ext/spl/spl_iterators.h:24:0,
                 from /tmp/cphalcon/build/php7/64bits/phalcon.zep.c:83:
/usr/include/php/ext/pcre/php_pcre.h:45:14: note: declared here
 PHPAPI void  php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
              ^~~~~~~~~~~~~~~~~~~
make: *** [phalcon.lo] Error 1

Thanks,
Nick

All 2 comments

PHP 7.4 isn't supported for Phalcon 3.4. You should be able to run Phalcon 4 on 7.4. Related https://github.com/phalcon/cphalcon/issues/14574#issuecomment-560303839

Is there any chance a new version 3.4.6 could be create with PHP 7.4 support? I have an application running on an old version of Phalcon and moving to Phalcon 4.0 involves more changes that I am capable of making with my limited knowledge of Phalon.
I know this is not your problem, but it would really get me (and possibly other who follow) out of a deep hole.

The error I get when trying to "make" 3.5.5 is:

/tmp/cphalcon/build/php7/64bits/phalcon.zep.c:7707:3: error: too many arguments to function 'php_pcre_match_impl'
   php_pcre_match_impl(pce, Z_STRVAL_P(subject), Z_STRLEN_P(subject), return_value, &tmp_matches, global, 0, 0, 0);
   ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/php/ext/spl/spl_iterators.h:24:0,
                 from /tmp/cphalcon/build/php7/64bits/phalcon.zep.c:83:
/usr/include/php/ext/pcre/php_pcre.h:45:14: note: declared here
 PHPAPI void  php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
              ^~~~~~~~~~~~~~~~~~~
make: *** [phalcon.lo] Error 1

Thanks,
Nick

Was this page helpful?
0 / 5 - 0 ratings