Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在macOS上安装php amqp扩展失败_Php - Fatal编程技术网

在macOS上安装php amqp扩展失败

在macOS上安装php amqp扩展失败,php,Php,我的PHP版本是8.0 当我尝试安装amqp扩展时,我会这样做: # This is required because it seems apple dropped openssl ... export PKG_CONFIG_PATH='$PKG_CONFIG_PATH:/usr/local/Cellar/rabbitmq-c/0.11.0/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig' pecl install amqp 结果是

我的PHP版本是8.0

当我尝试安装amqp扩展时,我会这样做:

# This is required because it seems apple dropped openssl ...
export PKG_CONFIG_PATH='$PKG_CONFIG_PATH:/usr/local/Cellar/rabbitmq-c/0.11.0/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig'
pecl install amqp
结果是这样的:

In file included from /private/tmp/pear/temp/amqp/amqp.c:43:
In file included from /private/tmp/pear/temp/amqp/php_amqp.h:54:
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:38:73: error: expected ')'
void php_amqp_prepare_for_disconnect(amqp_connection_resource *resource TSRMLS_DC);
                                                                        ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:38:37: note: to match this '('
void php_amqp_prepare_for_disconnect(amqp_connection_resource *resource TSRMLS_DC);
                                    ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:62:142: error: expected ')'
int php_amqp_connection_resource_error(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *resource, amqp_channel_t channel_id TSRMLS_DC);
                                                                                                                                             ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:62:39: note: to match this '('
int php_amqp_connection_resource_error(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *resource, amqp_channel_t channel_id TSRMLS_DC);
                                      ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:63:181: error: expected ')'
int php_amqp_connection_resource_error_advanced(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *resource, amqp_channel_t channel_id, amqp_channel_object *channel TSRMLS_DC);
                                                                                                                                                                                    ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:63:48: note: to match this '('
int php_amqp_connection_resource_error_advanced(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *resource, amqp_channel_t channel_id, amqp_channel_object *channel TSRMLS_DC);
                                               ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:66:96: error: expected ')'
int php_amqp_set_resource_read_timeout(amqp_connection_resource *resource, double read_timeout TSRMLS_DC);
                                                                                               ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:66:39: note: to match this '('
int php_amqp_set_resource_read_timeout(amqp_connection_resource *resource, double read_timeout TSRMLS_DC);
                                      ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:67:98: error: expected ')'
int php_amqp_set_resource_write_timeout(amqp_connection_resource *resource, double write_timeout TSRMLS_DC);
                                                                                                 ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:67:40: note: to match this '('
int php_amqp_set_resource_write_timeout(amqp_connection_resource *resource, double write_timeout TSRMLS_DC);
                                       ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:70:94: error: expected ')'
int php_amqp_set_resource_rpc_timeout(amqp_connection_resource *resource, double rpc_timeout TSRMLS_DC);
                                                                                             ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:70:38: note: to match this '('
int php_amqp_set_resource_rpc_timeout(amqp_connection_resource *resource, double rpc_timeout TSRMLS_DC);
                                     ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:78:112: error: expected ')'
amqp_connection_resource *connection_resource_constructor(amqp_connection_params *params, zend_bool persistent TSRMLS_DC);
                                                                                                               ^
/private/tmp/pear/temp/amqp/amqp_connection_resource.h:78:58: note: to match this '('
amqp_connection_resource *connection_resource_constructor(amqp_connection_params *params, zend_bool persistent TSRMLS_DC);
                                                         ^
In file included from /private/tmp/pear/temp/amqp/amqp.c:43:
/private/tmp/pear/temp/amqp/php_amqp.h:378:147: error: expected ')'
int php_amqp_error(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *connection_resource, amqp_channel_resource *channel_resource TSRMLS_DC);
                                                                                                                                                  ^
/private/tmp/pear/temp/amqp/php_amqp.h:378:19: note: to match this '('
int php_amqp_error(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *connection_resource, amqp_channel_resource *channel_resource TSRMLS_DC);
                  ^
/private/tmp/pear/temp/amqp/php_amqp.h:379:176: error: expected ')'
int php_amqp_error_advanced(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *connection_resource, amqp_channel_resource *channel_resource, int fail_on_errors TSRMLS_DC);
                                                                                                                                                                               ^
/private/tmp/pear/temp/amqp/php_amqp.h:379:28: note: to match this '('
int php_amqp_error_advanced(amqp_rpc_reply_t reply, char **message, amqp_connection_resource *connection_resource, amqp_channel_resource *channel_resource, int fail_on_errors TSRMLS_DC);
                           ^
/private/tmp/pear/temp/amqp/php_amqp.h:384:144: error: expected ')'
void php_amqp_zend_throw_exception(amqp_rpc_reply_t reply, zend_class_entry *exception_ce, const char *message, PHP5to7_param_long_type_t code TSRMLS_DC);
                                                                                                                                               ^
/private/tmp/pear/temp/amqp/php_amqp.h:384:35: note: to match this '('
void php_amqp_zend_throw_exception(amqp_rpc_reply_t reply, zend_class_entry *exception_ce, const char *message, PHP5to7_param_long_type_t code TSRMLS_DC);
                                  ^
/private/tmp/pear/temp/amqp/php_amqp.h:385:97: error: expected ')'
void php_amqp_zend_throw_exception_short(amqp_rpc_reply_t reply, zend_class_entry *exception_ce TSRMLS_DC);
                                                                                                ^
/private/tmp/pear/temp/amqp/php_amqp.h:385:41: note: to match this '('
void php_amqp_zend_throw_exception_short(amqp_rpc_reply_t reply, zend_class_entry *exception_ce TSRMLS_DC);
                                        ^
In file included from /private/tmp/pear/temp/amqp/amqp.c:44:
/private/tmp/pear/temp/amqp/amqp_connection.h:28:67: error: expected ')'
void php_amqp_disconnect_force(amqp_connection_resource *resource TSRMLS_DC);
                                                                  ^
/private/tmp/pear/temp/amqp/amqp_connection.h:28:31: note: to match this '('
void php_amqp_disconnect_force(amqp_connection_resource *resource TSRMLS_DC);
                              ^
In file included from /private/tmp/pear/temp/amqp/amqp.c:45:
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:29:57: error: expected ')'
void parse_amqp_table(amqp_table_t *table, zval *result TSRMLS_DC);
                                                        ^
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:29:22: note: to match this '('
void parse_amqp_table(amqp_table_t *table, zval *result TSRMLS_DC);
                     ^
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:30:78: error: expected ')'
void php_amqp_basic_properties_extract(amqp_basic_properties_t *p, zval *obj TSRMLS_DC);
                                                                             ^
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:30:39: note: to match this '('
void php_amqp_basic_properties_extract(amqp_basic_properties_t *p, zval *obj TSRMLS_DC);
                                      ^
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:33:90: error: expected ')'
void php_amqp_basic_properties_convert_to_zval(amqp_basic_properties_t *props, zval *obj TSRMLS_DC);
                                                                                         ^
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:33:47: note: to match this '('
void php_amqp_basic_properties_convert_to_zval(amqp_basic_properties_t *props, zval *obj TSRMLS_DC);
                                              ^
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:34:60: error: expected ')'
void php_amqp_basic_properties_set_empty_headers(zval *obj TSRMLS_DC);
                                                           ^
/private/tmp/pear/temp/amqp/amqp_basic_properties.h:34:49: note: to match this '('
void php_amqp_basic_properties_set_empty_headers(zval *obj TSRMLS_DC);
                                                ^
In file included from /private/tmp/pear/temp/amqp/amqp.c:47:
/private/tmp/pear/temp/amqp/amqp_channel.h:25:93: error: expected ')'
void php_amqp_close_channel(amqp_channel_resource *channel_resource, zend_bool check_errors TSRMLS_DC);
                                                                                            ^
/private/tmp/pear/temp/amqp/amqp_channel.h:25:28: note: to match this '('
void php_amqp_close_channel(amqp_channel_resource *channel_resource, zend_bool check_errors TSRMLS_DC);
                           ^
In file included from /private/tmp/pear/temp/amqp/amqp.c:48:
/private/tmp/pear/temp/amqp/amqp_envelope.h:25:83: error: expected ')'
void convert_amqp_envelope_to_zval(amqp_envelope_t *amqp_envelope, zval *envelope TSRMLS_DC);
                                                                                  ^
/private/tmp/pear/temp/amqp/amqp_envelope.h:25:35: note: to match this '('
void convert_amqp_envelope_to_zval(amqp_envelope_t *amqp_envelope, zval *envelope TSRMLS_DC);
                                  ^
/private/tmp/pear/temp/amqp/amqp.c:132:103: error: use of undeclared identifier 'TSRMLS_C'
        amqp_exception_class_entry = PHP5to7_zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C));
                                                                                                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [amqp.lo] Error 1
ERROR: `make' failed

好的,明白了。AMQP扩展目前不是为PHP8.0发布的稳定版本。这是由于windows下仍需要修复的错误造成的。这意味着您可以在Linux或macOS下安装php amqp

为此,请使用以下命令:

export PKG_CONFIG_PATH='$PKG_CONFIG_PATH:/usr/local/Cellar/rabbitmq-c/0.11.0/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig'
pecl install amqp-1.11.0beta

这有用吗?不幸的是,这描述了我尝试做事的方式。