macOS 上 MAMP 或 XAMPP 上的安装错误 phalcon

Posted

技术标签:

【中文标题】macOS 上 MAMP 或 XAMPP 上的安装错误 phalcon【英文标题】:installation error phalcon on MAMP or XAMPP on macOS 【发布时间】:2020-04-15 19:21:53 【问题描述】:

我正在尝试在 xampp 上安装 phalcon 或在 macOS 上安装 MAMP

请告诉我如何在 MAMP 上正确安装 phalcon(我在 XAMPP 上安装时遇到同样的错误)

我用这个教程https://madebyextreme.com/insights/how-to-install-phalcon-php-framework-with-mamp-on-osx

请帮帮我!我使用 php 7.3.7

错误:

./install: line 133: aclocal: command not found
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
appending configuration tag "CXX" to libtool
mkdir .libs
 gcc -I. -I/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits -DPHP_ATOM_INC -I/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/include -I/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/main -I/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -mtune=native -O2 -fomit-frame-pointer -c /Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c  -fno-common -DPIC -o .libs/phalcon.o
In file included from /Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:52:
./phalcon.zep.h:5760:47: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
        ZEND_ARG_OBJ_INFO(0, uri, Psr\\Http\\Message\\UriInterface, 0)
                                                     ^
./phalcon.zep.h:10328:47: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
        ZEND_ARG_OBJ_INFO(0, uri, Psr\\Http\\Message\\UriInterface, 0)
                                                     ^
./phalcon.zep.h:10341:122: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
  ...0, 1, Psr\\Http\\Message\\UriInterface, 0)
                              ^
./phalcon.zep.h:19544:100: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_urlinterface_setbasepath, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                                   ^
./phalcon.zep.h:19544:105: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_urlinterface_setbasepath, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                                        ^
./phalcon.zep.h:19556:99: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_urlinterface_setbaseuri, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                                  ^
./phalcon.zep.h:19556:104: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_urlinterface_setbaseuri, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                                       ^
./phalcon.zep.h:30753:139: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
  ...0, 1, Phalcon\\Http\\Message\\UploadedFile, 0)
                                  ^
./phalcon.zep.h:30815:129: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
  ...0, 2, Phalcon\\Http\\Message\\Uri, 0)
                                  ^
./phalcon.zep.h:31150:134: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
  ...0, 1, Psr\\Http\\Message\\UploadedFileInterface, 0)
                              ^
./phalcon.zep.h:31241:116: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withfragment, 0, 1, Phalcon\\Http\\Message\\Uri, 0)
                                                                                                                   ^
./phalcon.zep.h:31249:112: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withpath, 0, 1, Phalcon\\Http\\Message\\Uri, 0)
                                                                                                               ^
./phalcon.zep.h:31257:112: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withport, 0, 1, Phalcon\\Http\\Message\\Uri, 0)
                                                                                                               ^
./phalcon.zep.h:31265:113: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withquery, 0, 1, Phalcon\\Http\\Message\\Uri, 0)
                                                                                                                ^
./phalcon.zep.h:31273:114: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withscheme, 0, 1, Phalcon\\Http\\Message\\Uri, 0)
                                                                                                                 ^
./phalcon.zep.h:31281:116: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withuserinfo, 0, 1, Phalcon\\Http\\Message\\Uri, 0)
                                                                                                                   ^
./phalcon.zep.h:31290:112: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_uri_withhost, 0, 1, Phalcon\\Http\\Message\\Uri, 0)
                                                                                                               ^
./phalcon.zep.h:31422:116: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_message_urifactory_createuri, 0, 0, Psr\\Http\\Message\\UriIn...
                                                                                                                   ^
./phalcon.zep.h:45839:89: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_tag_geturlservice, 0, 0, Phalcon\\Url\\UrlInterface, 0)
                                                                                        ^
./phalcon.zep.h:45839:94: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_tag_geturlservice, 0, 0, Phalcon\\Url\\UrlInterface, 0)
                                                                                             ^
./phalcon.zep.h:47203:87: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_setbasepath, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                      ^
./phalcon.zep.h:47203:92: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_setbasepath, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                           ^
./phalcon.zep.h:47215:86: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_setbaseuri, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                     ^
./phalcon.zep.h:47215:91: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_setbaseuri, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                          ^
./phalcon.zep.h:47227:92: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_setstaticbaseuri, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                           ^
./phalcon.zep.h:47227:97: warning: \U used with no following hex digits; treating as '\' followed by identifier [-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_url_setstaticbaseuri, 0, 1, Phalcon\\Url\\UrlInterface, 0)
                                                                                                ^
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:8282:9: warning: nonnull parameter 'ce' will
      evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
        while (ce) 
        ~~~~~  ^~
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:3061:83: note: declared 'nonnull' here
static int zephir_has_constructor_ce(const zend_class_entry *ce) ZEPHIR_ATTR_PURE ZEPHIR_ATTR_NONNULL;
                                                                                  ^
./php_phalcon.h:73:45: note: expanded from macro 'ZEPHIR_ATTR_NONNULL'
# define ZEPHIR_ATTR_NONNULL __attribute__((nonnull))
                                            ^
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:12759:74: warning: format specifies type 'long'
      but the argument has type 'zend_long' (aka 'long long') [-Wformat]
                php_error_docref(NULL, E_WARNING, "max(%ld) is smaller than min(%ld)", max, min);
                                                       ~~~                             ^~~
                                                       %lld
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:12759:79: warning: format specifies type 'long'
      but the argument has type 'zend_long' (aka 'long long') [-Wformat]
                php_error_docref(NULL, E_WARNING, "max(%ld) is smaller than min(%ld)", max, min);
                                                                                ~~~         ^~~
                                                                                %lld
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140546:35: warning: \U used with no following hex
      digits; treating as '\' followed by identifier [-Wunicode]
        ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Url, Exception, phalcon, url_exception, phalcon_exception_ce, NULL, 0);
                                         ^
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140564:36: warning: \U used with no following hex
      digits; treating as '\' followed by identifier [-Wunicode]
        ZEPHIR_REGISTER_INTERFACE(Phalcon\\Url, UrlInterface, phalcon, url_urlinterface, phalcon_url_urlinterface_method_entry);
                                          ^
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140757:65: warning: incompatible pointer types
      passing 'zend_ulong *' (aka 'unsigned long long *') to parameter of type 'unsigned long *' [-Wincompatible-pointer-types]
  ...replace = phalcon_replace_marker(1, paths, replacements, &position, cursor, marker);
                                                              ^~~~~~~~~
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140625:89: note: passing argument to parameter
      'position' here
zval *phalcon_replace_marker(int named, zval *paths, zval *replacements, unsigned long *position, char *cursor, char *marker)
                                                                                        ^
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140791:65: warning: incompatible pointer types
      passing 'zend_ulong *' (aka 'unsigned long long *') to parameter of type 'unsigned long *' [-Wincompatible-pointer-types]
  ...replace = phalcon_replace_marker(0, paths, replacements, &position, cursor, marker);
                                                              ^~~~~~~~~
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140625:89: note: passing argument to parameter
      'position' here
zval *phalcon_replace_marker(int named, zval *paths, zval *replacements, unsigned long *position, char *cursor, char *marker)
                                                                                        ^
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140817:64: warning: incompatible pointer types
      passing 'zend_ulong *' (aka 'unsigned long long *') to parameter of type 'unsigned long *' [-Wincompatible-pointer-types]
                                                replace = phalcon_replace_marker(0, paths, replacements, &position, curso...
                                                                                                         ^~~~~~~~~
/Applications/XAMPP/xamppfiles/htdocs/cphalcon/build/php7/64bits/phalcon.zep.c:140625:89: note: passing argument to parameter
      'position' here
zval *phalcon_replace_marker(int named, zval *paths, zval *replacements, unsigned long *position, char *cursor, char *marker)

【问题讨论】:

【参考方案1】:

从 4.0.0 版开始,Phalcon 需要 PSR 扩展。该扩展可以从this GitHub repository 下载和编译。安装说明可在存储库的 README 文件中找到。扩展编译完成并在您的系统中可用后,您需要将其加载到您的php.ini。您需要添加这一行:

extension=psr.so

之前

extension=phalcon.so

另外,某些发行版会在 ini 文件上添加数字前缀。如果是这种情况,请为 Phalcon 选择一个较大的数字(例如 50-phalcon.ini20-psr.ini)。

【讨论】:

以上是关于macOS 上 MAMP 或 XAMPP 上的安装错误 phalcon的主要内容,如果未能解决你的问题,请参考以下文章

如何在 MAMP 安装上从终端运行 mysql 命令?

从 MAMP 开发环境到 XAMPP

Xdebug 安装失败,因为使用 MAMP 在 macOS Big Sur 上“phpize”失败

MAMP 和 XAMPP 的 mysql 密码更改如何工作?

无法在 Mac 上更改 mamp 端口

使用 MAMP 在 mac os 上 phpize 问题