liexusong / php-beast

PHP source code encrypt module (PHP源码加密扩展)
1.71k stars 505 forks source link

Compiling BEAST from PHp8 failed #127

Open Jack7244 opened 4 years ago

Jack7244 commented 4 years ago

/soft/php/php-beast-master/beast.c:177:55: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’ int filter_code_comments(char filename, zval retval TSRMLS_DC) ^~~~~ /soft/php/php-beast-master/beast.c:255:22: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’ int encrypt_type TSRMLS_DC) ^~~~~ /soft/php/php-beast-master/beast.c:352:40: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’ struct beast_ops *ret_encrypt TSRMLS_DC) ^~~~~ /soft/php/php-beast-master/beast.c:583:48: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’ cgi_compile_file(zend_file_handle h, int type TSRMLS_DC) ^~~~~ /soft/php/php-beast-master/beast.c: In function ‘zm_startup_beast’: /soft/php/php-beast-master/beast.c:1297:31: error: expected ‘)’ before ‘TSRMLS_CC’ php_error_docref(NULL TSRMLS_CC, E_ERROR, ^~~~~ /soft/php/php-beast-master/beast.c:1297:9: error: too few arguments to function ‘php_error_docref’ php_error_docref(NULL TSRMLS_CC, E_ERROR, ^~~~ In file included from /soft/php/php-beast-master/beast.c:42: /usr/local/php8/include/php/main/php.h:339:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char docref, int type, const char format, ...) ^~~~ /soft/php/php-beast-master/beast.c:1303:31: error: expected ‘)’ before ‘TSRMLS_CC’ php_error_docref(NULL TSRMLS_CC, E_ERROR, ^~~~~ /soft/php/php-beast-master/beast.c:1303:9: error: too few arguments to function ‘php_error_docref’ php_error_docref(NULL TSRMLS_CC, E_ERROR, ^~~~ In file included from /soft/php/php-beast-master/beast.c:42: /usr/local/php8/include/php/main/php.h:339:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char docref, int type, const char format, ...) ^~~~ /soft/php/php-beast-master/beast.c:1328:31: error: expected ‘)’ before ‘TSRMLS_CC’ php_error_docref(NULL TSRMLS_CC, ^~~~~ /soft/php/php-beast-master/beast.c:1328:9: error: too few arguments to function ‘php_error_docref’ php_error_docref(NULL TSRMLS_CC, ^~~~ In file included from /soft/php/php-beast-master/beast.c:42: /usr/local/php8/include/php/main/php.h:339:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char docref, int type, const char format, ...) ^~~~ /soft/php/php-beast-master/beast.c:1334:31: error: expected ‘)’ before ‘TSRMLS_CC’ php_error_docref(NULL TSRMLS_CC, ^~~~~ /soft/php/php-beast-master/beast.c:1334:9: error: too few arguments to function ‘php_error_docref’ php_error_docref(NULL TSRMLS_CC, ^~~~ In file included from /soft/php/php-beast-master/beast.c:42: /usr/local/php8/include/php/main/php.h:339:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char docref, int type, const char format, ...) ^~~~ /soft/php/php-beast-master/beast.c:1345:35: error: expected ‘)’ before ‘TSRMLS_CC’ php_error_docref(NULL TSRMLS_CC, ^~~~~ /soft/php/php-beast-master/beast.c:1345:13: error: too few arguments to function ‘php_error_docref’ php_error_docref(NULL TSRMLS_CC, ^~~~ In file included from /soft/php/php-beast-master/beast.c:42: /usr/local/php8/include/php/main/php.h:339:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char docref, int type, const char format, ...) ^~~~ /soft/php/php-beast-master/beast.c:1351:35: error: expected ‘)’ before ‘TSRMLS_CC’ php_error_docref(NULL TSRMLS_CC, ^~~~~ /soft/php/php-beast-master/beast.c:1351:13: error: too few arguments to function ‘php_error_docref’ php_error_docref(NULL TSRMLS_CC, ^~~~ In file included from /soft/php/php-beast-master/beast.c:42: /usr/local/php8/include/php/main/php.h:339:23: note: declared here PHPAPI ZEND_COLD void php_error_docref(const char docref, int type, const char format, ...) ^~~~ /soft/php/php-beast-master/beast.c:1359:25: error: ‘cgi_compile_file’ undeclared (first use in this function); did you mean ‘old_compile_file’? zend_compile_file = cgi_compile_file; ^~~~ old_compile_file /soft/php/php-beast-master/beast.c:1359:25: note: each undeclared identifier is reported only once for each function it appears in /soft/php/php-beast-master/beast.c: In function ‘zif_beast_file_expire’: /soft/php/php-beast-master/beast.c:1457:47: error: expected ‘)’ before ‘TSRMLS_CC’ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", ^~~~~ /soft/php/php-beast-master/beast.c:1457:9: error: too few arguments to function ‘zend_parse_parameters’ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", ^~~~~ In file included from /soft/php/php-beast-master/beast.c:39: /usr/local/php8/include/php/Zend/zend_API.h:304:22: note: declared here ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char type_spec, ...); ^~~~~ /soft/php/php-beast-master/beast.c:1498:75: error: expected ‘)’ before ‘TSRMLS_CC’ string = (char )php_format_date(format, strlen(format), expire, 1 TSRMLS_CC); ^~~~~~ ) /soft/php/php-beast-master/beast.c: In function ‘zif_beast_encode_file’: /soft/php/php-beast-master/beast.c:1525:47: error: expected ‘)’ before ‘TSRMLS_CC’ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", ^~~~~ /soft/php/php-beast-master/beast.c:1525:9: error: too few arguments to function ‘zend_parse_parameters’ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ll", ^~~~~ In file included from /soft/php/php-beast-master/beast.c:39: /usr/local/php8/include/php/Zend/zend_API.h:304:22: note: declared here ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec, ...); ^~~~~ /soft/php/php-beast-master/beast.c:1553:11: warning: implicit declaration of function ‘encrypt_file’ [-Wimplicit-function-declaration] ret = encrypt_file(input, output, ^~~~ /soft/php/php-beast-master/beast.c:1554:53: error: expected ‘)’ before ‘TSRMLS_CC’ (int)expire, (int)encrypt_type TSRMLS_CC); ^~~~~~ ) make: *** [Makefile:208: beast.lo] Error 1

abxuz commented 3 years ago

根据找到的资料 https://bugs.php.net/bug.php?id=80106,TSRM开头的宏定义已经没有用了,所以在PHP8版本中已经移除了这些宏,所以只需要再重新定义下 TSRMLS_DC、TSRMLS_CC、TSRMLS_C这三个宏,就可以编译过了。

jrffrj commented 1 year ago

define IGNORE_URL_WIN 0

define TSRMLS_DC

define TSRMLS_CC

define TSRMLS_C

//file_handle.free_filename = 0;