GoogleCloudPlatform / appengine-php-extension

Apache License 2.0
16 stars 13 forks source link

It does not compile on Ubuntu 15.10 #1

Closed iblue closed 8 years ago

iblue commented 8 years ago

The default g++ is:

iblue@raven:~/tmp/appengine-php-extension$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.3-5ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.3 (Ubuntu 4.9.3-5ubuntu1) 

PHP is

iblue@raven:~/tmp/appengine-php-extension$ php -v
PHP 5.6.11-1ubuntu3.1 (cli) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

Note: I also tried g++ 4.7 and g++ 5.2 by setting CXX=g++-4.7 before ./configure

I tried the following:

sudo apt-get install protobuf-compiler php5-dev libprotobuf-dev
cd /tmp
git clone git@github.com:GoogleCloudPlatform/appengine-php-extension.git
cd appengine-php-extension
protoc --cpp_out=. remote_api.proto
protoc --cpp_out=. urlfetch_service.proto
phpize
./configure --enable-gae --with-protobuf_inc=/usr/include --with-protobuf_lib=/usr/lib
make

And I get a compiler error

/bin/bash /home/iblue/tmp/appengine-php-extension/libtool --mode=compile g++ -DUSE_REMOTE_API -fPIC -I/usr/include -I. -I/home/iblue/tmp/appengine-php-extension -DPHP_ATOM_INC -I/home/iblue/tmp/appengine-php-extension/include -I/home/iblue/tmp/appengine-php-extension/main -I/home/iblue/tmp/appengine-php-extension -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc -o gae_runtime_module.lo 
libtool: compile:  g++ -DUSE_REMOTE_API -fPIC -I/usr/include -I. -I/home/iblue/tmp/appengine-php-extension -DPHP_ATOM_INC -I/home/iblue/tmp/appengine-php-extension/include -I/home/iblue/tmp/appengine-php-extension/main -I/home/iblue/tmp/appengine-php-extension -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc  -fPIC -DPIC -o .libs/gae_runtime_module.o
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:91:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wwritable-strings"  // PHP APIs not const safe.
                                ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc: In function 'void load_user_ini(int, int)':
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:498:56: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
                           user_ini_hash_table TSRMLS_CC);
                                                        ^
In file included from /usr/include/php5/main/php.h:407:0,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.h:25,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:18:
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc: In function 'void enable_allowed_include_streams(int, int)':
/usr/include/php5/Zend/zend_constants.h:45:144: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define REGISTER_STRING_CONSTANT(name, str, flags)  zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC)
                                                                                                                                                ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:565:5: note: in expansion of macro 'REGISTER_STRING_CONSTANT'
     REGISTER_STRING_CONSTANT("GAE_INCLUDE_GS_BUCKETS",
     ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc: In function 'php_stream_wrapper* appengine::get_correct_stream_wrapper(const char*, char**, int)':
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:766:59: error: invalid conversion from 'char**' to 'const char**' [-fpermissive]
                                          options TSRMLS_CC);
                                                           ^
In file included from /usr/include/php5/main/php.h:399:0,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.h:25,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:18:
/usr/include/php5/main/php_streams.h:552:28: note: initializing argument 2 of 'php_stream_wrapper* php_stream_locate_url_wrapper(const char*, const char**, int)'
 PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC);
                            ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:770:59: error: invalid conversion from 'char**' to 'const char**' [-fpermissive]
                                          options TSRMLS_CC);
                                                           ^
In file included from /usr/include/php5/main/php.h:399:0,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.h:25,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:18:
/usr/include/php5/main/php_streams.h:552:28: note: initializing argument 2 of 'php_stream_wrapper* php_stream_locate_url_wrapper(const char*, const char**, int)'
 PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options TSRMLS_DC);
                            ^
In file included from /usr/include/php5/main/php_ini.h:24:0,
                 from /usr/include/php5/main/fopen_wrappers.h:26,
                 from /usr/include/php5/main/php.h:401,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.h:25,
                 from /home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:18:
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc: At global scope:
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
/usr/include/php5/Zend/zend_ini.h:115:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define ZEND_INI_END()  { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
                                                                                                 ^
/usr/include/php5/main/php_ini.h:56:23: note: in expansion of macro 'ZEND_INI_END'
 #define PHP_INI_END   ZEND_INI_END
                       ^
/home/iblue/tmp/appengine-php-extension/gae_runtime_module.cc:864:1: note: in expansion of macro 'PHP_INI_END'
 PHP_INI_END()
 ^
Makefile:181: recipe for target 'gae_runtime_module.lo' failed
make: *** [gae_runtime_module.lo] Error 1
marslangoog commented 8 years ago

Unfortunately there are some backward incompatible changes made in PHP 5.6. Try compiling against PHP 5.5 instead.

marslangoog commented 8 years ago

For future reference, the change refers to https://github.com/php/php-src/commit/92d27ccb0574f901a107409a7fec92888fa2b82f

robfrawley commented 8 years ago

@marslangoog The official answer is use a PHP version that reaches complete EOL in a month (on 10 Jul 2016)? Forget PHP 5.5 or 5.6, when is support for 7.0 coming? PHP 5.6 stops non-security fixes in 6 months!

FossPrime commented 8 years ago

This makes it unpalatable to compile the extension in Fedora 24. The barrier to entry to app engine is sometimes astonishing.

robfrawley commented 8 years ago

Yup. App Engine is useless for anyone running supported versions of PHP.

pks11iitr commented 7 years ago

Totally waste of time. Very poor documentation provided by google. Not working for ubuntu 16.04 and php 7.0

robfrawley commented 7 years ago

The insanity here is that no PHP version currently supported (meaning no version that hasn't reached end of life) is supported by App Engine!