PHPFastCGI / php5-fastcgi

A PHP FastCGI extension
Other
22 stars 1 forks source link

PHP 7 #2

Open gnugat opened 8 years ago

gnugat commented 8 years ago

Here's the question that was bound to be asked... Is there any plan to have a PHP 7 extension?

PHPFastCGI lib works just fine, I'm just trying to break boundaries even further with the extension. Thank you for this awesome project!

I've followed the instruction in README for php5-fastcgi with PHP 7 (PHP 7.0.3-5+deb.sury.org~trusty+1) and got the following:

phpize

Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

Looks OK

configure

checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20151012
checking for PHP installed headers prefix... /usr/include/php/20151012
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable the FastCGI extension... yes, shared
checking libfcgi... no
checking for libfcgi... in default path: found in /usr
checking for FCGX_Accept in -lfcgi... yes
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands

Looks OK

make

/bin/bash /home/foobar/projects/phpfastcgi/php5-fastcgi/libtool --mode=compile cc -I/usr/include -I. -I/home/foobar/projects/phpfastcgi/php5-fastcgi -DPHP_ATOM_INC -I/home/foobar/projects/phpfastcgi/php5-fastcgi/include -I/home/foobar/projects/phpfastcgi/php5-fastcgi/main -I/home/foobar/projects/phpfastcgi/php5-fastcgi -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c -o fastcgi.lo 
libtool: compile:  cc -I/usr/include -I. -I/home/foobar/projects/phpfastcgi/php5-fastcgi -DPHP_ATOM_INC -I/home/foobar/projects/phpfastcgi/php5-fastcgi/include -I/home/foobar/projects/phpfastcgi/php5-fastcgi/main -I/home/foobar/projects/phpfastcgi/php5-fastcgi -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c  -fPIC -DPIC -o .libs/fastcgi.o
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class___construct':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:45:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_accept':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:72:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_finish':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:87:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_setExitStatus':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:102:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_getParam':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:123:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:134:25: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1
   RETURN_STRING(value, 1);
                         ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:134:3: error: 'RETURN_STRING' undeclared (first use in this function)
   RETURN_STRING(value, 1);
   ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:134:3: note: each undeclared identifier is reported only once for each function it appears in
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_getParams':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:149:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:168:48: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
   add_assoc_string(return_value, name, value, 1);
                                                ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:168:3: error: 'add_assoc_string' undeclared (first use in this function)
   add_assoc_string(return_value, name, value, 1);
   ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_stdinRead':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:186:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:207:25: error: lvalue required as left operand of assignment
  Z_TYPE_P(return_value) = IS_STRING;
                         ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:208:27: error: incompatible types when assigning to type 'char[1]' from type 'char *'
  Z_STRVAL_P(return_value) = buffer;
                           ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_stdinEof':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:220:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_stdoutWrite':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:236:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zim_fastcgi_application_class_stdoutEof':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:260:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  class_object = (php_fastcgi_application_class_object *) zend_object_store_get_object(object TSRMLS_CC);
                 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: At top level:
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:341:1: error: unknown type name 'zend_object_value'
 static zend_object_value php_fastcgi_application_class_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
 ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'php_fastcgi_application_class_new':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:344:2: error: unknown type name 'zend_object_value'
  zend_object_value retval;
  ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:352:8: error: request for member 'handle' in something not a structure or union
  retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_fastcgi_application_class_free_storage, NULL TSRMLS_CC);
        ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:352:56: error: 'zend_objects_free_object_storage_t' undeclared (first use in this function)
  retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_fastcgi_application_class_free_storage, NULL TSRMLS_CC);
                                                        ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:352:92: error: expected ')' before 'php_fastcgi_application_class_free_storage'
  retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_fastcgi_application_class_free_storage, NULL TSRMLS_CC);
                                                                                            ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:352:92: warning: passing argument 1 of 'zend_objects_store_put' from incompatible pointer type [enabled by default]
In file included from /usr/include/php/20151012/Zend/zend_globals.h:35:0,
                 from /usr/include/php/20151012/Zend/zend_compile.h:657,
                 from /usr/include/php/20151012/Zend/zend_modules.h:26,
                 from /usr/include/php/20151012/Zend/zend_API.h:27,
                 from /usr/include/php/20151012/main/php.h:40,
                 from /home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:7:
/usr/include/php/20151012/Zend/zend_objects_API.h:58:15: note: expected 'struct zend_object *' but argument is of type 'struct php_fastcgi_application_class_object *'
 ZEND_API void zend_objects_store_put(zend_object *object);
               ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:352:92: error: too many arguments to function 'zend_objects_store_put'
  retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_fastcgi_application_class_free_storage, NULL TSRMLS_CC);
                                                                                            ^
In file included from /usr/include/php/20151012/Zend/zend_globals.h:35:0,
                 from /usr/include/php/20151012/Zend/zend_compile.h:657,
                 from /usr/include/php/20151012/Zend/zend_modules.h:26,
                 from /usr/include/php/20151012/Zend/zend_API.h:27,
                 from /usr/include/php/20151012/main/php.h:40,
                 from /home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:7:
/usr/include/php/20151012/Zend/zend_objects_API.h:58:15: note: declared here
 ZEND_API void zend_objects_store_put(zend_object *object);
               ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:353:8: error: request for member 'handlers' in something not a structure or union
  retval.handlers = (zend_object_handlers *) &fastcgi_application_class_handlers;
        ^
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c: In function 'zm_startup_fastcgi':
/home/foobar/projects/phpfastcgi/php5-fastcgi/fastcgi.c:374:46: warning: assignment from incompatible pointer type [enabled by default]
  local_application_class_entry.create_object = php_fastcgi_application_class_new;
                                              ^
make: *** [fastcgi.lo] Error 1

Failed, possibly due to backward incompatibility between PHP 7 and PHP 5.

AndrewCarterUK commented 8 years ago

Hello,

I was actually looking at PHP-7 extensions the other day - and I don't believe it would take too much effort to update this to work on PHP-7.

I'll be looking at this over the next few days :)

jjsaunier commented 8 years ago

@AndrewCarterUK :+1: cool, thank you!

gnugat commented 8 years ago

@AndrewCarterUK thank you it's much appreciated. Especially regarding all the efforts you're putting into standardizing asynchronous for PHP :+1:

AndrewCarterUK commented 8 years ago

:) For reference this extension is not asynchronous, as it's just exposing libfcgi to PHP - which is not an asynchronous library.

Even the PHP userland implementation is only really asynchronous in its core - it doesn't yet allow you to write truly asynchronous code. I've been working on the interoperability of event loops, which would allow for this to happen (and would require this extension to be rewritten!). It's likely this will be in place for v2, but I'm aiming at PHP7 support and some decoupling for v1.

Nyholm commented 6 years ago

FYI: here is a good article that mentions updates to the api. https://wiki.php.net/phpng-upgrading