phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.79k stars 1.96k forks source link

can not build cphalcon 2.1.x with php 7.0.4 #11635

Closed ghost closed 8 years ago

ghost commented 8 years ago

current branch

git status
On branch 2.1.x
Your branch is up-to-date with 'origin/2.1.x'.
nothing to commit, working directory clean

PHP version

PHP 7.0.4 (cli) (built: Mar  9 2016 02:18:50) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

can not build, and error log

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
/bin/bash /var/www/html/cphalcon/build/64bits/libtool --mode=compile gcc  -I. -I/var/www/html/cphalcon/build/64bits -DPHP_ATOM_INC -I/var/www/html/cphalcon/build/64bits/include -I/var/www/html/cphalcon/build/64bits/main -I/var/www/html/cphalcon/build/64bits -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DPHALCON_RELEASE -DHAVE_CONFIG_H  -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden   -c /var/www/html/cphalcon/build/64bits/phalcon.zep.c -o phalcon.lo 
mkdir .libs
 gcc -I. -I/var/www/html/cphalcon/build/64bits -DPHP_ATOM_INC -I/var/www/html/cphalcon/build/64bits/include -I/var/www/html/cphalcon/build/64bits/main -I/var/www/html/cphalcon/build/64bits -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c /var/www/html/cphalcon/build/64bits/phalcon.zep.c  -fPIC -DPIC -o .libs/phalcon.o
In file included from /var/www/html/cphalcon/build/64bits/phalcon.zep.c:175:0:
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:428:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Validator(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:2472:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Logger_Adapter(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:3188:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Application(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:3545:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Dispatcher(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:6197:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Router(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:7243:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Assets_Collection(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:8451:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Cli_Console(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:8494:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Cli_Dispatcher(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:8570:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Cli_Router(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:10291:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Debug_Dump(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:11039:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Forms_Form(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:11821:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:12180:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Loader(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:12678:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Collection(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:14792:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apc(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:14821:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Files(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:14851:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Libmemcached(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:14882:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memcache(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:14912:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memory(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:14942:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Redis(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:15046:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Xcache(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:16107:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Mvc_Router_Annotations(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:18356:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Translate_Adapter_Csv(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.h:18738:8: error: unknown type name 'zend_object_value'
 static zend_object_value zephir_init_properties_Phalcon_Validation_Message_Group(zend_class_entry *class_type TSRMLS_DC);
        ^
/var/www/html/cphalcon/build/64bits/phalcon.zep.c:184:40: fatal error: ext/standard/php_smart_str.h: No such file or directory
 #include <ext/standard/php_smart_str.h>
andresgutierrez commented 8 years ago

Are you using zephir to build the extension? The standard way to compile does not work

https://blog.phalconphp.com/post/phalcon-2-1-0-RC1-released

sergeyklay commented 8 years ago

refs #11550

Izopi4a commented 8 years ago

which php and which php-config should point to php7 btw, compilation works. Its just the result that doesnt work.

also make sure to use

zephir fullclean
zephir build --zendEngine=3
Green-Cat commented 8 years ago

What version of zephir are you using?

Lewiscowles1986 commented 8 years ago

please see https://gist.github.com/Lewiscowles1986/4928f7dd04c599b64ba041fd7334f9c3 for compilation in a ubuntu environment, as long as you get the deps right, you should be able to use the other steps to build on any OS

stefanchiriac commented 8 years ago

I can confirm this doesn't work on ubuntu 16.04 php 7.0.4

zephir fullclean
zephir build --backend=ZendEngine3

Segmentation fault (core dumped)

Lewiscowles1986 commented 8 years ago

@stefanchiriac are you using docker per-chance?

If so, I get the same error in docker, but I'm pretty sure it's an issue with docker, not the build

stefanchiriac commented 8 years ago

no docker. Is a fresh Ubuntu 16.04 x64 install on my main desktop

Lewiscowles1986 commented 8 years ago

any more info on the error, anyone have any ideas what could cause this? https://kb.iu.edu/d/aqsj

I don't think it's a phalcon problem (it's compiling, so must be a compiler issue)

andresgutierrez commented 8 years ago

Try updating Zephir to the latest commit on master and then try compiling again.

stefanchiriac commented 8 years ago

I am already on latest version of master. The problem must be somewhere else.

trinaldi commented 8 years ago

Can confirm. Fresh install of Ubuntu 16.04 and getting the same SEGFAULT error.

abdul-khaliq commented 8 years ago

Phalcon is not working using windows 10 PHP 7.0.4

Jurigag commented 8 years ago

What you mean it's not working ?

abdul-khaliq commented 8 years ago

PHP Version 7.0.4 Downloaded DLL: php-version

Phalcon 2.1.0.RC1 - Windows x86 for PHP 5.6.0 NTS (vc11) March 22 2016 22:25:40 EDT / sha1: b19581586af38a60cee50f30e77f3f639c15da7a

C:\xampp\php\php.ini extension=php_phalcon.dll

DLL is not available for php 7 so i tried latest 5.6.0 but i cant see phalcon loaded in phpinfo

stefanchiriac commented 8 years ago

that dll is for PHP 5.6. Is not possible to work on PHP 7.0. Downgrade your php to 5.6. Phalcon for PHP 7.0 is not yet stable and is not yet recommended. Wait until everything is fixed on zephir and 2.1 will be released

Green-Cat commented 8 years ago

You cannot use DLLs built for older versions of php. That doesn't work for any extensions.

Green-Cat commented 8 years ago

If you want to try phalcon 2.1.x on windows (it has known bugs), then you need to build it from source.

abdul-khaliq commented 8 years ago

downgrade is problem now because many of my project are associated with 7... i've to find out other solution.

Thanks friends (y)

stefanchiriac commented 8 years ago

now back to topic, any news about the segmentation fault on ubuntu 16.04?

Jurigag commented 8 years ago

@abdul-khaliq

Wait a minute. You were writing whole project on phalcon and php7 and you are checking now if it's working ?

@stefanchiriac I still don't see the stack trace. No one even posted it. We can't figure out what causing a seg fault without stack trace. Install gdb and write:

gdb php /path/to/crash and then write bt and post here result

abdul-khaliq commented 8 years ago

@Jurigag

no i didn't write on php 7 and phalcon. Before i was using ubuntu 14.04 and php 5.6. Now i switched to windows and installed php 7 (xampp). so now i'm facing problem because there is no phalcon dll available for php 7.

Thanks

stefanchiriac commented 8 years ago

@abdul-khaliq on windows you can run on the same time another xampp with php 5.6. Just make sure you change the apache port to something else and don't start mysql.

Jurigag commented 8 years ago

@stefanchiriac so just switch to php 5.6

stefanchiriac commented 8 years ago

@Jurigag I did a gdb php /path/to/cphalcon but it says

is not a core dump: Is a directory

so what should be the path? I never done this before

When it says segmentation fault it doesn't give any other details

Jurigag commented 8 years ago

It should be path to crash dump. Read more here:

https://bugs.php.net/bugs-generating-backtrace.php

digitalogical commented 8 years ago

Not sure why this was closed? It's still broken.

Jurigag commented 8 years ago

I guess no information was provided.