Skip to content

Instantly share code, notes, and snippets.

@parseword
Created January 12, 2018 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parseword/49bcf0182b11cfef965db3ef4284008c to your computer and use it in GitHub Desktop.
Save parseword/49bcf0182b11cfef965db3ef4284008c to your computer and use it in GitHub Desktop.
Build errors compiling the pthreads extension for PHP 7.2 on CentOS 6

If you get errors like this when trying to compile pthreads for PHP 7.2, see the article Installing PHP 7.2 with pthreads on CentOS 6 for a solution.

[root@parox03 /home/files/php-7.2.1/ext/pthreads]# make
/bin/sh /home/files/php-7.2.1/ext/pthreads/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/home/files/php-7.2.1/ext/pthreads -DPHP_ATOM_INC -I/home/files/php-7.2.1/ext/pthreads/include -I/home/files/php-7.2.1/ext/pthreads/main -I/home/files/php-7.2.1/ext/pthreads -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 -I/home/files/php-7.2.1/ext/pthreads/.  -DHAVE_CONFIG_H  -g -O2   -c /home/files/php-7.2.1/ext/pthreads/php_pthreads.c -o php_pthreads.lo
mkdir .libs
 cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/home/files/php-7.2.1/ext/pthreads -DPHP_ATOM_INC -I/home/files/php-7.2.1/ext/pthreads/include -I/home/files/php-7.2.1/ext/pthreads/main -I/home/files/php-7.2.1/ext/pthreads -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 -I/home/files/php-7.2.1/ext/pthreads/. -DHAVE_CONFIG_H -g -O2 -c /home/files/php-7.2.1/ext/pthreads/php_pthreads.c  -fPIC -DPIC -o .libs/php_pthreads.o
In file included from ./php_pthreads.h:31,
                 from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:26:
./classes/threaded.h:89:78: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
In file included from ./php_pthreads.h:31,
                 from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:26:
./classes/threaded.h:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘}’ token
In file included from ./php_pthreads.h:39,
                 from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:26:
./classes/collectable.h:20:81: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
In file included from ./php_pthreads.h:39,
                 from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:26:
./classes/collectable.h:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘}’ token
In file included from ./php_pthreads.h:51,
                 from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:26:
./classes/socket.h:47:76: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
In file included from ./php_pthreads.h:51,
                 from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:26:
./classes/socket.h:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:48: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:49: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:50: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:53:75: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:54: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:55: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:58:71: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:59: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:59: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:60: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:63:73: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:64: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:64: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:67:74: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:68: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:69: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:72:72: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:73: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:73: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:74: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:77:71: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:78: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:78: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:79: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:82:70: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:83: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:83: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:84: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:85: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:88:78: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:89: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:92:74: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:93: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:93: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:96:72: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" requires 6 arguments, but only 5 given
./classes/socket.h:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./classes/socket.h:97: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:98: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:99: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:100: error: expected identifier or ‘(’ before ‘,’ token
./classes/socket.h:101: error: expected identifier or ‘(’ before ‘,’ token
/home/files/php-7.2.1/ext/pthreads/php_pthreads.c:38:3: error: #error "pthreads requires PHP 7.2, ZTS in versions 7.0 and 7.1 is broken"
In file included from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:51:
./src/copy.h: In function ‘pthreads_copy_arginfo’:
./src/copy.h:307: error: ‘zend_arg_info’ has no member named ‘type’
./src/copy.h:307: error: ‘zend_arg_info’ has no member named ‘type’
./src/copy.h:308: error: ‘zend_arg_info’ has no member named ‘type’
./src/copy.h:309: error: ‘zend_arg_info’ has no member named ‘type’
./src/copy.h:309: error: ‘zend_arg_info’ has no member named ‘type’
./src/copy.h:311: error: ‘zend_arg_info’ has no member named ‘type’
/home/files/php-7.2.1/ext/pthreads/php_pthreads.c: In function ‘pthreads_verify_type’:
/home/files/php-7.2.1/ext/pthreads/php_pthreads.c:162: error: ‘zend_arg_info’ has no member named ‘type’
/home/files/php-7.2.1/ext/pthreads/php_pthreads.c:166: error: ‘zend_arg_info’ has no member named ‘type’
/home/files/php-7.2.1/ext/pthreads/php_pthreads.c:184: error: ‘zend_arg_info’ has no member named ‘type’
/home/files/php-7.2.1/ext/pthreads/php_pthreads.c:188: error: ‘zend_arg_info’ has no member named ‘type’
In file included from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:898:
./classes/threaded.h: At top level:
./classes/threaded.h:109: error: ‘Threaded_isGarbage’ undeclared here (not in a function)
In file included from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:906:
./classes/collectable.h:28: error: ‘Collectable_isGarbage’ undeclared here (not in a function)
./classes/collectable.h:28: error: initializer element is not constant
./classes/collectable.h:28: error: (near initialization for ‘pthreads_collectable_methods[0].arg_info’)
./classes/collectable.h:28: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/collectable.h:28: warning: cast from pointer to integer of different size
./classes/collectable.h:28: error: initializer element is not constant
./classes/collectable.h:28: error: (near initialization for ‘pthreads_collectable_methods[0].num_args’)
In file included from /home/files/php-7.2.1/ext/pthreads/php_pthreads.c:918:
./classes/socket.h:117: error: ‘Socket_setOption’ undeclared here (not in a function)
./classes/socket.h:117: error: initializer element is not constant
./classes/socket.h:117: error: (near initialization for ‘pthreads_socket_methods[1].arg_info’)
./classes/socket.h:117: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:117: warning: cast from pointer to integer of different size
./classes/socket.h:117: error: initializer element is not constant
./classes/socket.h:117: error: (near initialization for ‘pthreads_socket_methods[1].num_args’)
./classes/socket.h:118: error: ‘Socket_getOption’ undeclared here (not in a function)
./classes/socket.h:118: error: initializer element is not constant
./classes/socket.h:118: error: (near initialization for ‘pthreads_socket_methods[2].arg_info’)
./classes/socket.h:118: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:118: warning: cast from pointer to integer of different size
./classes/socket.h:118: error: initializer element is not constant
./classes/socket.h:118: error: (near initialization for ‘pthreads_socket_methods[2].num_args’)
./classes/socket.h:119: error: ‘Socket_bind’ undeclared here (not in a function)
./classes/socket.h:119: error: initializer element is not constant
./classes/socket.h:119: error: (near initialization for ‘pthreads_socket_methods[3].arg_info’)
./classes/socket.h:119: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:119: warning: cast from pointer to integer of different size
./classes/socket.h:119: error: initializer element is not constant
./classes/socket.h:119: error: (near initialization for ‘pthreads_socket_methods[3].num_args’)
./classes/socket.h:120: error: ‘Socket_listen’ undeclared here (not in a function)
./classes/socket.h:120: error: initializer element is not constant
./classes/socket.h:120: error: (near initialization for ‘pthreads_socket_methods[4].arg_info’)
./classes/socket.h:120: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:120: warning: cast from pointer to integer of different size
./classes/socket.h:120: error: initializer element is not constant
./classes/socket.h:120: error: (near initialization for ‘pthreads_socket_methods[4].num_args’)
./classes/socket.h:122: error: ‘Socket_connect’ undeclared here (not in a function)
./classes/socket.h:122: error: initializer element is not constant
./classes/socket.h:122: error: (near initialization for ‘pthreads_socket_methods[6].arg_info’)
./classes/socket.h:122: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:122: warning: cast from pointer to integer of different size
./classes/socket.h:122: error: initializer element is not constant
./classes/socket.h:122: error: (near initialization for ‘pthreads_socket_methods[6].num_args’)
./classes/socket.h:123: error: ‘Socket_select’ undeclared here (not in a function)
./classes/socket.h:123: error: initializer element is not constant
./classes/socket.h:123: error: (near initialization for ‘pthreads_socket_methods[7].arg_info’)
./classes/socket.h:123: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:123: warning: cast from pointer to integer of different size
./classes/socket.h:123: error: initializer element is not constant
./classes/socket.h:123: error: (near initialization for ‘pthreads_socket_methods[7].num_args’)
./classes/socket.h:124: error: ‘Socket_read’ undeclared here (not in a function)
./classes/socket.h:124: error: initializer element is not constant
./classes/socket.h:124: error: (near initialization for ‘pthreads_socket_methods[8].arg_info’)
./classes/socket.h:124: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:124: warning: cast from pointer to integer of different size
./classes/socket.h:124: error: initializer element is not constant
./classes/socket.h:124: error: (near initialization for ‘pthreads_socket_methods[8].num_args’)
./classes/socket.h:125: error: ‘Socket_write’ undeclared here (not in a function)
./classes/socket.h:125: error: initializer element is not constant
./classes/socket.h:125: error: (near initialization for ‘pthreads_socket_methods[9].arg_info’)
./classes/socket.h:125: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:125: warning: cast from pointer to integer of different size
./classes/socket.h:125: error: initializer element is not constant
./classes/socket.h:125: error: (near initialization for ‘pthreads_socket_methods[9].num_args’)
./classes/socket.h:126: error: ‘Socket_send’ undeclared here (not in a function)
./classes/socket.h:126: error: initializer element is not constant
./classes/socket.h:126: error: (near initialization for ‘pthreads_socket_methods[10].arg_info’)
./classes/socket.h:126: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:126: warning: cast from pointer to integer of different size
./classes/socket.h:126: error: initializer element is not constant
./classes/socket.h:126: error: (near initialization for ‘pthreads_socket_methods[10].num_args’)
./classes/socket.h:127: error: ‘Socket_setBlocking’ undeclared here (not in a function)
./classes/socket.h:127: error: initializer element is not constant
./classes/socket.h:127: error: (near initialization for ‘pthreads_socket_methods[11].arg_info’)
./classes/socket.h:127: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:127: warning: cast from pointer to integer of different size
./classes/socket.h:127: error: initializer element is not constant
./classes/socket.h:127: error: (near initialization for ‘pthreads_socket_methods[11].num_args’)
./classes/socket.h:128: error: ‘Socket_getHost’ undeclared here (not in a function)
./classes/socket.h:128: error: initializer element is not constant
./classes/socket.h:128: error: (near initialization for ‘pthreads_socket_methods[12].arg_info’)
./classes/socket.h:128: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:128: warning: cast from pointer to integer of different size
./classes/socket.h:128: error: initializer element is not constant
./classes/socket.h:128: error: (near initialization for ‘pthreads_socket_methods[12].num_args’)
./classes/socket.h:129: error: initializer element is not constant
./classes/socket.h:129: error: (near initialization for ‘pthreads_socket_methods[13].arg_info’)
./classes/socket.h:129: error: invalid operands to binary / (have ‘struct zend_function_entry *’ and ‘long unsigned int’)
./classes/socket.h:129: warning: cast from pointer to integer of different size
./classes/socket.h:129: error: initializer element is not constant
./classes/socket.h:129: error: (near initialization for ‘pthreads_socket_methods[13].num_args’)
make: *** [php_pthreads.lo] Error 1
[root@parox03 /home/files/php-7.2.1/ext/pthreads]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment