brew yaf error: unknown type name 'HASHKIT_API'

1.在 mac 系統中安裝 PHP yaf 擴展時,總是失敗;報錯:error: unknown type name 'HASHKIT_API'

\h:\W \u$ brew install php70-yaf
==> Installing php70-yaf from homebrew/php
==> Downloading https://github.com/laruence/yaf/archive/yaf-3.0.3.tar.gz
Already downloaded: /Users/liuqh/Library/Caches/Homebrew/php70-yaf-3.0.3.tar.gz
==> /usr/local/opt/php70/bin/phpize
==> ./configure --prefix=/usr/local/Cellar/php70-yaf/3.0.3 --with-php-config=/usr/local/opt/php70/bin/php-config
==> make
Last 15 lines from /Users/liuqh/Library/Logs/Homebrew/php70-yaf/03.make:
/usr/local/include/string.h:56:1: error: unknown type name 'HASHKIT_API'
HASHKIT_API
^
/usr/local/include/string.h:57:1: error: expected identifier or '('
const char *hashkit_string_c_str(const hashkit_string_st* self);
^
6 errors generated.
make: *** [yaf_bootstrap.lo] Error 1
make: *** Waiting for unfinished jobs....
6 errors generated.
make: *** [yaf.lo] Error 1
6 errors generated.
make: *** [yaf_application.lo] Error 1
6 errors generated.
make: *** [yaf_dispatcher.lo] Error 1

====> 解決方法:
找到/usr/local/include/string.h 註釋調和'HASHKIT_API有關的代碼;


/*=============================20180314 解決yaf 裝不上的問題,註釋
#HASHKIT_API
void hashkit_string_free(hashkit_string_st *ptr);

#HASHKIT_API
size_t hashkit_string_length(const hashkit_string_st *self);

#HASHKIT_API
const char *hashkit_string_c_str(const hashkit_string_st* self);

#================================================================
*/
========補充===========

以上的解決方法有問題,雖然 phpinfo 能顯示 yaf 擴展;但是實際使用中會報錯;
>>> nginx 報錯:
     2018/03/16 12:01:44 [error] 4965#0: *25 kevent() reported about an closed connection (54: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET /test/lqh/test?XDEBUG_SESSION_START=19833 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.cloudins.com"

>>>php-fpm報錯:

[16-Mar-2018 12:21:27] NOTICE: fpm is running, pid 6593
[16-Mar-2018 12:21:27] NOTICE: ready to handle connections
[16-Mar-2018 12:22:01] WARNING: [pool www] child 6594 exited on signal 11 (SIGSEGV) after 34.532384 seconds from start
[16-Mar-2018 12:22:01] NOTICE: [pool www] child 6602 started
[16-Mar-2018 14:10:02] NOTICE: Finishing ...
[16-Mar-2018 14:10:02] NOTICE: exiting, bye-bye!

=========================================================
這些錯誤信息各種 google,都沒有對應的解決方案,只是遇到同樣問題的人;後來最後的解決方法是從同事電腦 (MacBook Pro)brew安裝好的包直接引入;我的電腦是(MacBook),個人猜測是電腦系統(/usr/local/include)中文件的問題,因爲我發現MacBook Pro該目錄中沒有這些文件;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章