allegro/php-protobuf

Error while installation, step 3 Build and install the PHP extension.

rajvanshipradeep15 opened this issue · 2 comments

My System configuration
MacOS Sierra version 10.12.6
Trying to install on PHP 5.6.36

From Installation step. In the 3rd step when I run the command "make"

$ cd extname
$ phpize
$ ./configure
$ make

make install

I get the following error.
Part of my error from console

Pradeeps-MacBook-Air:php-protobuf pradeeprajvanshi$ make
/bin/sh /Applications/MAMP/htdocs/whatsup/php-protobuf/libtool --mode=compile cc -I. -I/Applications/MAMP/htdocs/whatsup/php-protobuf -DPHP_ATOM_INC -I/Applications/MAMP/htdocs/whatsup/php-protobuf/include -I/Applications/MAMP/htdocs/whatsup/php-protobuf/main -I/Applications/MAMP/htdocs/whatsup/php-protobuf -I/usr/local/Cellar/php@5.6/5.6.36/include/php -I/usr/local/Cellar/php@5.6/5.6.36/include/php/main -I/usr/local/Cellar/php@5.6/5.6.36/include/php/TSRM -I/usr/local/Cellar/php@5.6/5.6.36/include/php/Zend -I/usr/local/Cellar/php@5.6/5.6.36/include/php/ext -I/usr/local/Cellar/php@5.6/5.6.36/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Applications/MAMP/htdocs/whatsup/php-protobuf/protobuf.c -o protobuf.lo
mkdir .libs
cc -I. -I/Applications/MAMP/htdocs/whatsup/php-protobuf -DPHP_ATOM_INC -I/Applications/MAMP/htdocs/whatsup/php-protobuf/include -I/Applications/MAMP/htdocs/whatsup/php-protobuf/main -I/Applications/MAMP/htdocs/whatsup/php-protobuf -I/usr/local/Cellar/php@5.6/5.6.36/include/php -I/usr/local/Cellar/php@5.6/5.6.36/include/php/main -I/usr/local/Cellar/php@5.6/5.6.36/include/php/TSRM -I/usr/local/Cellar/php@5.6/5.6.36/include/php/Zend -I/usr/local/Cellar/php@5.6/5.6.36/include/php/ext -I/usr/local/Cellar/php@5.6/5.6.36/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Applications/MAMP/htdocs/whatsup/php-protobuf/protobuf.c -fno-common -DPIC -o .libs/protobuf.o
/Applications/MAMP/htdocs/whatsup/php-protobuf/protobuf.c:19:9: warning: 'IS_BOOL' macro redefined [-Wmacro-redefined]
#define IS_BOOL(zval) ((Z_TYPE(zval) == IS_FALSE) || (Z_TYPE(zval) == IS_TRUE))
^
/usr/local/Cellar/php@5.6/5.6.36/include/php/Zend/zend.h:586:9: note: previous definition is here
#define IS_BOOL 3
^
/Applications/MAMP/htdocs/whatsup/php-protobuf/protobuf.c:73:46: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
static int pb_print_field_value(zval *value, zend_long level, zend_bool only_set);
^~~~~~~~~
zend_ulong
/usr/local/Cellar/php@5.6/5.6.36/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
^
/Applications/MAMP/htdocs/whatsup/php-protobuf/protobuf.c:74:45: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
static int pb_dump_field_value(zval *value, zend_long level, zend_bool only_set);
^~~~~~~~~
zend_ulong
/usr/local/Cellar/php@5.6/5.6.36/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
.
.

finally I get this.

fatal error: too many errors emitted, stopping now [-ferror-limit=]
15 warnings and 20 errors generated.
make: *** [protobuf.lo] Error 1

Hi thanks I got it, you were right I was using the master branch php7 instead of php5