We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to compile phalcon with latest zephyr? Compiled from source Phalcon php7.1 still has fixed bug from zephyr in it.

Hi I have compiled and am using phalcon.so using the guide: https://docs.phalcon.io/en/3.0.0/reference/install.html#compile-from-source

I am getting error:

[29-Mar-2017 17:01:56 UTC] Call to undefined method self::_groupresult(), did you mean 'undefined'?

I beleive this is a fixed but unreleased issue: https://github.com/phalcon/zephir/issues/1372

So assuming all the above is true my question is how do I build phalcon with the latest zephir?



85.5k
    git clone zephir
    git submodule init
    git submodule update

if you already did install zephir , make sure you go to the parser and

    make clean
    phpize --clean
    which phpize # this one should be showing php 7.1
    which php-config # the 7.1 one again
    which php # hopefully u get the point

if those are not ok, check their sym links are for ubuntu usually are in /etc/alternatives, or /usr/bin, you need to replace them if they are not the 7.1 ones

once done

cd phalcon

zephir build --zendEngine=3

you dont nessery have to use --zendEngine=3 but this is how i do it, since php 7 and it seems to be working

dont forget to restart services



47.7k

Thanks!

It attempted a compilation but the compiler returned errors:

duplicate symbol _tsrm_ls in: .libs/phalcon.o phalcon/mvc/model/behavior/.libs/softdelete.o ld: 405 duplicate symbols for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [phalcon.la] Error 1

Also an example warning:

Warning: Function "bindtextdomain" does not exist at compile time in /usr/local/src/cphalcon/phalcon/translate/adapter/gettext.zep on 181 [nonexistent-function]

 bindtextdomain(this->getDefaultDomain(), directory);

------------------------------------------------------^



85.5k

git checkout 3.1.x, git pull origin 3.1.x ?



85.5k

also cd zephir/parser/parser ; # yes twise

make clean phpize --clean

Warning is totally fine, just ignore it, warning is happening because you don't have php extension gettext enabled.



47.7k

In /usr/local/src/zephir/parser/parser:

$ make clean
 make: *** No rule to make target `clean'.  Stop.

 $ phpize --clean
 Cannot find config.m4. 

also cd zephir/parser/parser ; # yes twise

make clean phpize --clean



47.7k

If you mean which version of phalcon then it is 3.1.1being used.

The bug only crops up in php 7.1.

So it looks like I'll just try reverting my php version for now 7.0.17 as zephir compilation fails at time of writing.

git checkout 3.1.x, git pull origin 3.1.x ?



85.5k

if you are in slack, write me there - @izo , and we can fix it.

i am using 7.1 atm and there are no problems.

probably you didnt

make clean
phpize --clean

the parser



47.7k

Ok thanks!

if you are in slack, write me there - @izo , and we can fix it.

i am using 7.1 atm and there are no problems.

probably you didnt

make clean
phpize --clean

the parser



47.7k
Accepted
answer

This issue is resolved now as latest cphalcon now uses latest zephir!