標籤:分享 ber 官網 its 錯誤 type and cat 發布
表現:
/home/sphinx-1.1.0/sphinx.c: In function ‘php_sphinx_client_read_property’:
/home/sphinx-1.1.0/sphinx.c:105:2: error: too few arguments to function ‘std_hnd->read_property’
/home/sphinx-1.1.0/sphinx.c: In function ‘zim_SphinxClient_updateAttributes’:
/home/sphinx-1.1.0/sphinx.c:1040:6: warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:77:1: note: expected ‘int’ but argument is of type ‘void *’
/home/sphinx-1.1.0/sphinx.c: In function ‘zm_startup_sphinx’:
/home/sphinx-1.1.0/sphinx.c:1888:43: warning: assignment from incompatible pointer type [enabled by default]
sphinx-1.1.0/sphinx.c:105:2: error: too few arguments
解決
之前在PHP 5.2.16以及5.3.17環境下安裝PECL擴充sphinx-1.1.0時,均成功.但今日在PHP 5.4.10環境下
安裝sphinx-1.1.0時,卻遇到錯誤.
遇到的錯誤在PHP官網上作為bug由其他使用者反應了,見
https://bugs.php.net/bug.php?id=61241
解決方式:
1.來自PHP開發人員[email protected]的回複,在SVN發布的PHP更新源碼中進行了修複.
回複時間是: 2012-06-12 19:17 UTC
因為所使用的PHP是採用伺服器系統安裝的,因此此方式不適合.
2.參照回複者andrew at cbtech dot co dot uk的回複,對sphinx-1.1.0的源碼修改,再進行編譯安裝.
下面是其回複內容:
If you change line 105 of sphinx.c from:
retval = std_hnd->read_property(object, member, type TSRMLS_CC);
to
retval = std_hnd->read_property(object, member, type TSRMLS_CC, NULL);
it compiles and seems to work.
編輯安裝方式簡單描述:
- # tar -xzf sphinx-1.1.0.tgz
- # cd sphinx-1.1.0
- # vi sphinx.c
- # ./configure
- # make && make install
好文要頂 關注我 收藏該文
安裝PHP sphinx擴充 sphinx-1.1.0/sphinx.c:105:2: error: too few arguments 錯誤