Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Segmentation fault while compiling

I am trying to compile PhalconPHP 2.1 with PHP 7, but I am getting a segmentation fault, in fact, I am getting it also with another extension that I've built.

I have downloaded and installed several Zephir changesets, including the one from todays, but I always get the same results.

$ git clone https://github.com/phalcon/zephir
$ cd zephir
$ ./install -c

When trying to compile Phalcon 2.1 with PHP, I do this:

$ zephir build --backend=ZendEngine3
/usr/local/bin/zephir: line 26: 25275 Segmentation fault      php -d safe_mode=Off -d enable_dl=On $ZEPHIRDIR/compiler.php $*

Seems that the $ZEPHIRDIR is incorrect, anyway, if I try to do it on comand line, I get a segmentation fault too:

$ php -d safe_mode=Off -d enable_dl=On /root/compile/zephir/compiler.php build --backend=ZendEngine3
Segmentation fault

If I do a full clean:

$ zephir fullclean
sudo: phpize: command not found
./clean: 11: ./clean: phpize: not found

These is the info from my system, PHP has been compiled by myself:

$ php -v
PHP 7.0.5 (cli) (built: Apr 17 2016 16:15:32) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
   with Xdebug v2.4.1-dev, Copyright (c) 2002-2016, by Derick Rethans

phpize

$ phpize -v
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

Any ideas what is going on here? any help will be appreciated.

Regards, Hugo.

phpize: not found

Have you installed all required dependencies?

Hello,

Yes I have, all dependencies are installed, it was working with the previous version, phpize it's installed and working properly.

Regards.



474
Accepted
answer

Hello,

I've found a solution here: https://forum.phalconphp.com/discussion/11063/can-not-build-cphalcon-21x-with-php-705#C32883, I've just made a small change for it to work:

git clone http://github.com/phalcon/zephir
cd zephir
cd parser/parser
./build_linux.sh php7
cd ..
make clean
phpize --clean
phpize
./configure
make
make install

I am now able to build Phalcon and other projects.

Regards.