首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在macOS上安装php amqp扩展失败

在macOS上安装php amqp扩展失败
EN

Stack Overflow用户
提问于 2021-05-08 02:06:29
回答 1查看 179关注 0票数 0

我的PHP版本是8.0。

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

代码语言:javascript
复制
# 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

结果是这样的:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2021-05-11 05:24:28

好的,明白了。AMQP扩展当前不在为PHP 8.0发布的稳定版本中。这是由于windows下的一个bug,仍然需要修复。这意味着你可以在Linux或macOS下安装php-amqp。

要执行此操作,请使用以下命令:

代码语言:javascript
复制
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
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67439792

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档